Skip to main content

ScrapeRequestDto

Struct ScrapeRequestDto 

Source
pub struct ScrapeRequestDto {
Show 23 fields pub async_: Option<bool>, pub block_ads: Option<bool>, pub body: Option<ScrapeRequestDtoBody>, pub cache_only: Option<bool>, pub dismiss_cookies: Option<bool>, pub dismiss_popups: Option<bool>, pub exclude_tags: Vec<String>, pub formats: Vec<ScrapeRequestDtoFormatsItem>, pub headers: HashMap<String, String>, pub include_links: Option<bool>, pub include_tags: Vec<String>, pub json_options: Option<JsonOptionsDto>, pub location: Option<LocationDto>, pub max_age: Option<f64>, pub method: ScrapeRequestDtoMethod, pub only_main_content: Option<bool>, pub prefer_structure: Option<bool>, pub remove_base64_images: Option<bool>, pub render: Option<bool>, pub store_in_cache: Option<bool>, pub timeout: Option<f64>, pub url: String, pub wait_for: Option<f64>,
}
Expand description

ScrapeRequestDto

Fields§

§async_: Option<bool>

Return a job id immediately instead of waiting for the result. Poll GET /v1/web/scrape/{id}. Opt in only: a synchronous call never degrades to a job id on its own, so you get a page or an error, not two response shapes.

§block_ads: Option<bool>

Remove ads and tracking elements. Default true.

§body: Option<ScrapeRequestDtoBody>

Request body, sent verbatim. Only used when method is POST. Set the content type yourself via headers; nothing is assumed about the format.

§cache_only: Option<bool>

Only serve from cache. If there is no fresh cached copy, return 404 instead of fetching.

§dismiss_cookies: Option<bool>

Remove cookie and consent banners. Default true. Set false to keep them; a banner the site adds with scripts after load is kept only when the page is rendered.

§dismiss_popups: Option<bool>

Close newsletter and promotion popups when the page is rendered. Default true. Set false to keep them.

§exclude_tags: Vec<String>

CSS selectors to strip before extraction.

§formats: Vec<ScrapeRequestDtoFormatsItem>

What to return. Omit for Markdown only. structured is the page’s own data (no LLM, cheapest); summary and json are LLM-backed and cost more.

§headers: HashMap<String, String>

Extra request headers to send when fetching the page.

§include_links: Option<bool>

Keep inline links in the markdown. By default links are kept wherever the page text carries them. Set true to keep them on every page, or false for the densest prose.

§include_tags: Vec<String>

CSS selectors to keep. When set, only matching elements are considered.

§json_options: Option<JsonOptionsDto>

Schema and/or prompt for the json format. One is required when json is requested.

§location: Option<LocationDto>§max_age: Option<f64>

Serve from cache if a capture of this URL is younger than this many milliseconds. Omit for the default window, two days for a page and one hour for a feed; 0 always fetches fresh. Capped at 7 days.

§method: ScrapeRequestDtoMethod

HTTP method to fetch the URL with. Use POST for endpoints that only answer a POST, such as JSON and GraphQL APIs. Defaults to GET.

§only_main_content: Option<bool>

Return only the main content, dropping nav/boilerplate. Default true.

§prefer_structure: Option<bool>

Preserve document structure (headings, lists, tables) over prose density — good for marketing and service pages. Default off.

§remove_base64_images: Option<bool>

Strip inline base64 images from the output. Default true.

§render: Option<bool>

Always read the page in a browser, as a visitor sees it once its scripts have run. Default false: the page is read in a browser only when its HTML is not enough. Combine with dismissCookies and dismissPopups set to false to keep what scripts add after load.

§store_in_cache: Option<bool>

Persist the capture for later re-extraction. Default true.

§timeout: Option<f64>

Overall time budget for the request, in milliseconds.

§url: String

The URL to scrape. Must be http(s); a bare domain such as example.com is read over https.

§wait_for: Option<f64>

Extra milliseconds to let the page settle before capture.

Trait Implementations§

Source§

impl Clone for ScrapeRequestDto

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScrapeRequestDto

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ScrapeRequestDto

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ScrapeRequestDto

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more