Skip to main content

scrapfly_sdk/
lib.rs

1//! # scrapfly-sdk
2//!
3//! Async Rust client for the Scrapfly API. See the crate-level
4//! [`Client`] and the `examples/` directory for usage.
5//!
6//! ```no_run
7//! use scrapfly_sdk::{Client, ScrapeConfig};
8//!
9//! # async fn run() -> Result<(), scrapfly_sdk::ScrapflyError> {
10//! let client = Client::builder().api_key("scp-...").build()?;
11//! let result = client
12//!     .scrape(&ScrapeConfig::builder("https://httpbin.dev/html").build()?)
13//!     .await?;
14//! println!("{}", result.result.status_code);
15//! # Ok(()) }
16//! ```
17
18#![deny(unsafe_code)]
19#![warn(missing_docs)]
20
21pub mod batch;
22pub mod client;
23pub mod cloud_browser;
24pub mod config;
25pub mod crawler;
26pub mod enums;
27pub mod error;
28pub mod monitoring;
29pub mod result;
30pub mod schedule;
31
32pub use client::{Client, ClientBuilder, OnRequest};
33pub use cloud_browser::{BrowserConfig, UnblockConfig, UnblockResult};
34pub use config::crawler::CrawlerConfig;
35pub use config::extraction::ExtractionConfig;
36pub use config::scrape::ScrapeConfig;
37pub use config::screenshot::ScreenshotConfig;
38pub use crawler::{Crawl, WaitOptions};
39pub use enums::*;
40pub use error::{ApiError, ScrapflyError};
41pub use monitoring::{
42    CloudBrowserMonitoringOptions, MonitoringAggregation, MonitoringDataFormat,
43    MonitoringMetricsOptions, MonitoringPeriod, MonitoringTargetMetricsOptions,
44};
45pub use result::account::{AccountData, VerifyApiKeyResult};
46pub use result::crawler::{
47    CrawlContent, CrawlerArtifact, CrawlerArtifactType, CrawlerContents, CrawlerStartResponse,
48    CrawlerStatus, CrawlerUrlEntry, CrawlerUrls,
49};
50pub use result::extraction::ExtractionResult;
51pub use result::scrape::ScrapeResult;
52pub use result::screenshot::{ScreenshotMetadata, ScreenshotResult};
53pub use schedule::{
54    CreateScheduleRequest, ListSchedulesOptions, Schedule, ScheduleEnd, ScheduleRecurrence,
55    UpdateScheduleRequest,
56};