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::default())
.with_chunk_size(5);
let mut count = 0;
while let Some(actor) = iter.next().await? {
let label = actor
.title
.or(actor.name)
.unwrap_or_else(|| "(untitled)".to_string());
println!("{}: {label}", actor.id);
count += 1;
if count >= 10 {
break;
}
}
println!("Iterated {count} store actors");
Ok(())
}