product_fees_v0/
product_fees_v0.rs

1use amazon_spapi::client::{SpapiClient, SpapiConfig};
2use anyhow::Result;
3
4#[tokio::main]
5async fn main() -> Result<()> {
6    let client = SpapiClient::new(SpapiConfig::from_env()?)?;
7
8    // let fee = client.get_fee_for_asin("B0DGJC52FP", 999.0, true).await?;
9    // println!("Fee for ASIN B0DGJC52FP: ${:.2}", fee);
10
11    let current_local_time = chrono::Local::now();
12    println!("Current local time: {}", current_local_time);
13    {
14        let fees = client
15            .get_fees_for_asins(vec![("B0DGJC52FP".to_string(), 999.0)], true)
16            .await?;
17        println!("Fees for ASINs: {:?}", fees);
18    }
19    let current_local_time = chrono::Local::now();
20    println!("Current local time: {}", current_local_time);
21    {
22        let fees = client
23            .get_fees_for_asins(vec![("B0DGJC52FP".to_string(), 999.0)], true)
24            .await?;
25        println!("Fees for ASINs: {:?}", fees);
26    }
27    let current_local_time = chrono::Local::now();
28    println!("Current local time: {}", current_local_time);
29    {
30        let fees = client
31            .get_fees_for_asins(vec![("B0DGJC52FP".to_string(), 999.0)], true)
32            .await?;
33        println!("Fees for ASINs: {:?}", fees);
34    }
35    let current_local_time = chrono::Local::now();
36    println!("Current local time: {}", current_local_time);
37
38    Ok(())
39}