#![allow(unused)]
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_16() {
use finance_query::{Ticker, Region};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::builder("MC.PA")
.region(Region::France)
.build()
.await?;
let ticker = Ticker::builder("SAP.DE")
.region(Region::Germany)
.build()
.await?;
let ticker = Ticker::builder("HSBA.L")
.region(Region::UnitedKingdom)
.build()
.await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_87() {
use finance_query::Ticker;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::builder("AAPL")
.lang("en-US")
.region_code("US")
.build()
.await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_109() {
use finance_query::Ticker;
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::builder("AAPL")
.timeout(Duration::from_secs(60)) .build()
.await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_127() {
use finance_query::Ticker;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::builder("AAPL")
.proxy("http://proxy.example.com:8080")
.build()
.await?;
let ticker = Ticker::builder("AAPL")
.proxy("http://user:pass@proxy.example.com:8080")
.build()
.await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_156() {
use finance_query::{Tickers, Region};
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let tickers = Tickers::builder(vec!["2330.TW", "2317.TW", "2454.TW"])
.region(Region::Taiwan)
.timeout(Duration::from_secs(60))
.build()
.await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_260() {
use finance_query::{Ticker, Interval, TimeRange};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::new("AAPL").await?;
let daily = ticker.chart(Interval::OneDay, TimeRange::OneYear).await?;
let intraday = ticker.chart(Interval::FiveMinutes, TimeRange::OneDay).await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_281() {
use finance_query::{Frequency, StatementType, Ticker};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::new("AAPL").await?;
let income_annual = ticker.financials(
StatementType::Income,
Frequency::Annual
).await?;
let income_quarterly = ticker.financials(
StatementType::Income,
Frequency::Quarterly
).await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_307() {
use finance_query::Ticker;
use finance_query::format::{Both, Pretty, Raw};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::new("AAPL").await?;
let raw = ticker.quote::<Raw>().await?; let pretty = ticker.quote::<Pretty>().await?; let both = ticker.quote::<Both>().await?; Ok(())
}
}
#[cfg(feature = "polygon")]
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_350() {
use finance_query::{Capability, Fetch, Provider, Providers, Ticker};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::new("AAPL").await?;
let providers = Providers::builder()
.route(Capability::QUOTE, [Provider::Polygon, Provider::Yahoo])
.route(Capability::FUNDAMENTALS, [Provider::Fmp, Provider::Yahoo])
.fetch(Fetch::Sequential)
.build()
.await?;
let ticker = providers.ticker("AAPL").build().await?;
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_382() {
use finance_query::{Region, Ticker, format::Raw};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let apple = Ticker::builder("AAPL")
.region(Region::UnitedStates)
.logo()
.build()
.await?;
let tsmc = Ticker::builder("2330.TW")
.region(Region::Taiwan)
.logo()
.build()
.await?;
let sap = Ticker::builder("SAP.DE")
.region(Region::Germany)
.logo()
.build()
.await?;
let (apple_quote, tsmc_quote, sap_quote) = tokio::join!(
apple.quote::<Raw>(),
tsmc.quote::<Raw>(),
sap.quote::<Raw>()
);
println!("{:?} {:?} {:?}", apple_quote?.symbol, tsmc_quote?.symbol, sap_quote?.symbol);
Ok(())
}
}
#[rustfmt::skip]
#[allow(dead_code)]
fn doc_block_line_427() {
use finance_query::Ticker;
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ticker = Ticker::builder("AAPL")
.proxy("http://corporate-proxy.company.com:8080")
.timeout(Duration::from_secs(45))
.build()
.await?;
Ok(())
}
}