use quiverquant::Client; use std::env::var; #[tokio::main] async fn main() { let api_token = var("QQ_API_KEY").expect("Please set your API token at QQ_API_KEY"); let client = Client::new(api_token); let contracts = client.gov_contracts().await.expect("Failed to Connect!"); println!("Government Contracts:"); for contract in contracts { println!( "Ticker: {}, Amount: {}, Year: {}, Qtr: {}", contract.ticker.unwrap_or_default(), contract.amount.unwrap_or_default(), contract.year, contract.qtr ) } println!("Government Contracts of Lockheed Martin:"); for contract in client.gov_contracts_by_ticker("LMT").await.expect("Failed to get LMT Contracts") { println!( "Amount: {}, Year: {}, Qtr: {}", contract.amount.unwrap_or(-1.0), contract.year, contract.qtr ) } }