Skip to main content

Crate apify_rs

Crate apify_rs 

Source
Expand description

Rust client for the Apify platform API.

Apify is a web scraping and automation cloud platform. Users publish Actors (serverless programs) to the Apify Store, run them with a JSON input, and retrieve structured results from Datasets or Key-Value Stores.

This crate mirrors the Apify REST API v2. It is organised around three primary resources:

ResourceWhat it representsTypical workflow
actorsScraping / automation programsPick an Actor and run it
tasksSaved Actor configurationsCreate once, run many times
runsSingle executionsPoll status, fetch output

§Disclaimer

This project was written with the help of large language models (LLMs). It is not well tested in production, so please review and test thoroughly before using it for critical workloads.

§Quick start

use apify_rs::ApifyClient;

let client = ApifyClient::new(std::env::var("APIFY_TOKEN")?);

// Run a task asynchronously
let run = client.tasks().run("my-task-id", None).await?;
println!("Started run {}", run.id);

// Poll until the run finishes
let finished = client.runs().wait_for_finish(&run.id, 5, 600).await?;
println!("Run finished with status {:?}", finished.status);

Re-exports§

pub use client::HttpClient;
pub use error::ApifyError;
pub use resources::actors::ActorClient;
pub use resources::runs::RunClient;
pub use resources::tasks::TaskClient;

Modules§

client
error
instagram
Typed output of the Instagram Profile Scraper Actor.
models
resources
Resource-oriented sub-clients for the Apify API.

Structs§

ApifyClient
Root client for the Apify API.
ApifyClientBuilder
Fluent builder for ApifyClient.