Expand description
§scrapfly-sdk
Async Rust client for the Scrapfly API. See the crate-level
Client and the examples/ directory for usage.
use scrapfly_sdk::{Client, ScrapeConfig};
let client = Client::builder().api_key("scp-...").build()?;
let result = client
.scrape(&ScrapeConfig::builder("https://httpbin.dev/html").build()?)
.await?;
println!("{}", result.result.status_code);Re-exports§
pub use client::Client;pub use client::ClientBuilder;pub use client::OnRequest;pub use cloud_browser::BrowserConfig;pub use cloud_browser::UnblockConfig;pub use cloud_browser::UnblockResult;pub use config::crawler::CrawlerConfig;pub use config::extraction::ExtractionConfig;pub use config::scrape::ScrapeConfig;pub use config::screenshot::ScreenshotConfig;pub use crawler::Crawl;pub use crawler::WaitOptions;pub use error::ApiError;pub use error::ScrapflyError;pub use result::account::AccountData;pub use result::account::VerifyApiKeyResult;pub use result::crawler::CrawlContent;pub use result::crawler::CrawlerArtifact;pub use result::crawler::CrawlerArtifactType;pub use result::crawler::CrawlerContents;pub use result::crawler::CrawlerStartResponse;pub use result::crawler::CrawlerStatus;pub use result::crawler::CrawlerUrlEntry;pub use result::crawler::CrawlerUrls;pub use result::extraction::ExtractionResult;pub use result::scrape::ScrapeResult;pub use result::screenshot::ScreenshotMetadata;pub use result::screenshot::ScreenshotResult;pub use enums::*;
Modules§
- HTTP client for the Scrapfly API.
- Cloud Browser API — port of
sdk/go/cloud_browser.go. - Typed config builders for every Scrapfly endpoint.
- High-level
Crawlwrapper — port ofsdk/go/crawl.go. - Strongly-typed enums mirroring
sdk/go/enums.go. - Error types — 1:1 port of
sdk/go/errors.go+crawler.go::parseAPIError. - Strongly-typed result objects for every Scrapfly endpoint.