pub struct ScrapeConfig {Show 42 fields
pub url: String,
pub method: Option<HttpMethod>,
pub body: Option<String>,
pub headers: BTreeMap<String, String>,
pub cookies: BTreeMap<String, String>,
pub country: Option<String>,
pub proxy_pool: Option<ProxyPool>,
pub render_js: bool,
pub asp: bool,
pub cache: bool,
pub cache_ttl: Option<u32>,
pub cache_clear: bool,
pub timeout: Option<u32>,
pub cost_budget: Option<u32>,
pub retry: Option<bool>,
pub session: Option<String>,
pub session_sticky_proxy: bool,
pub tags: Vec<String>,
pub webhook: Option<String>,
pub debug: bool,
pub ssl: bool,
pub dns: bool,
pub correlation_id: Option<String>,
pub format: Option<Format>,
pub format_options: Vec<FormatOption>,
pub extraction_template: Option<String>,
pub extraction_ephemeral_template: Option<Value>,
pub extraction_prompt: Option<String>,
pub extraction_model: Option<ExtractionModel>,
pub wait_for_selector: Option<String>,
pub rendering_wait: Option<u32>,
pub auto_scroll: bool,
pub screenshots: BTreeMap<String, String>,
pub screenshot_flags: Vec<ScreenshotFlag>,
pub js: Option<String>,
pub js_scenario: Option<Value>,
pub os: Option<String>,
pub lang: Vec<String>,
pub browser_brand: Option<String>,
pub geolocation: Option<String>,
pub rendering_stage: Option<String>,
pub proxified_response: bool,
}Expand description
Configuration for a single POST /scrape request.
Construct via ScrapeConfig::builder.
Fields§
§url: StringTarget URL (required).
method: Option<HttpMethod>HTTP method; defaults to GET.
body: Option<String>Raw request body.
headers: BTreeMap<String, String>Request headers (sent as headers[key]=value).
Cookies (merged into headers[cookie]).
country: Option<String>Proxy country.
proxy_pool: Option<ProxyPool>Proxy pool.
render_js: boolEnable JavaScript rendering.
asp: boolEnable Anti-Scraping Protection bypass.
cache: boolEnable cache.
cache_ttl: Option<u32>Cache TTL (seconds).
cache_clear: boolForce cache refresh.
timeout: Option<u32>Timeout in milliseconds.
cost_budget: Option<u32>Maximum API credit cost the caller is willing to spend on this request. If the server’s pre-flight estimate exceeds this budget the request is rejected before execution.
retry: Option<bool>Enable automatic retries.
session: Option<String>Session name.
session_sticky_proxy: boolSticky-proxy inside the session.
Custom tags.
webhook: Option<String>Webhook name.
debug: boolDebug mode.
ssl: boolCapture SSL details.
dns: boolCapture DNS details.
correlation_id: Option<String>Correlation ID.
format: Option<Format>Output format.
format_options: Vec<FormatOption>Format options.
extraction_template: Option<String>Saved extraction template name.
extraction_ephemeral_template: Option<Value>Inline (ephemeral) extraction template as JSON value.
extraction_prompt: Option<String>AI extraction prompt.
extraction_model: Option<ExtractionModel>Extraction model.
wait_for_selector: Option<String>Wait for CSS selector (requires render_js).
rendering_wait: Option<u32>Extra wait after page load, milliseconds.
auto_scroll: boolAuto-scroll to load lazy content.
screenshots: BTreeMap<String, String>Named screenshots (name → selector, or “fullpage”).
screenshot_flags: Vec<ScreenshotFlag>Screenshot flags.
js: Option<String>Inline JavaScript code (base64url-encoded on the wire).
js_scenario: Option<Value>JS scenario (serialized as JSON then base64url-encoded).
os: Option<String>OS fingerprint hint.
lang: Vec<String>Accept-Language values.
browser_brand: Option<String>Browser brand (chrome | edge | brave | opera).
geolocation: Option<String>Spoof browser geolocation. Format: "latitude,longitude".
rendering_stage: Option<String>Page load stage to wait for. complete (default) or domcontentloaded.
proxified_response: boolReturn the raw upstream response instead of the JSON envelope.
When true, callers must use Client::scrape_proxified() which
returns reqwest::Response directly.
Implementations§
Source§impl ScrapeConfig
impl ScrapeConfig
Sourcepub fn builder(url: impl Into<String>) -> ScrapeConfigBuilder
pub fn builder(url: impl Into<String>) -> ScrapeConfigBuilder
Start a builder for url.
Sourcepub fn to_query_pairs(&self) -> Result<Vec<(String, String)>, ScrapflyError>
pub fn to_query_pairs(&self) -> Result<Vec<(String, String)>, ScrapflyError>
Serialize the config into the query-parameter pairs that the
/scrape endpoint expects. Mirrors
sdk/go/config_scrape.go::toAPIParamsWithValidation.
Trait Implementations§
Source§impl Clone for ScrapeConfig
impl Clone for ScrapeConfig
Source§fn clone(&self) -> ScrapeConfig
fn clone(&self) -> ScrapeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more