use apify_client::{ApifyClient, StoreListOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let token = std::env::var("APIFY_TOKEN").expect("set APIFY_TOKEN");
let client = ApifyClient::new(token);
let mut iter = client.store().iterate(StoreListOptions {
limit: Some(5),
..Default::default()
});
let mut count = 0;
while let Some(actor) = iter.next().await? {
println!("{}: {:?}", actor.id, actor.title.or(actor.name));
count += 1;
if count >= 10 {
break;
}
}
println!("Iterated {count} store actors");
Ok(())
}