Skip to main content
POST
Fetch a page with a POST

Authorizations

apikey
string
query
required

Fetch, Extract, Crawl and the account endpoint accept the key as the apikey query parameter. Keys are per account and self-serve: create one in the Zenrows dashboard (app.zenrows.com), or, for an agent with no human present, POST https://app.zenrows.com/api/agent/signup.

Query Parameters

url
string<uri>
required

The URL of the page to retrieve. Only http and https URLs are accepted.

Pattern: ^https?://
Example:

"https://www.scrapingcourse.com/ecommerce/"

mode
enum<string>

Adaptive Stealth Mode. auto starts from the cheapest viable configuration and escalates to JavaScript rendering or premium proxies only when the target requires it. You are billed for the configuration that succeeds. It manages js_render and premium_proxy itself, so setting either alongside it answers 400 REQS004; proxy_country is allowed.

Available options:
auto
js_render
boolean
default:false

Render the page in a headless browser before returning it. Required for content that only exists after JavaScript runs. Not allowed with mode=auto (400 REQS004).

js_instructions
string

JSON array of browser instructions (click, fill, scroll, wait) executed on the page before the content is returned. Requires js_render=true or mode=auto; without either the request answers 400 REQS004.

custom_headers
boolean
default:false

Forward your own request headers (cookies, referer) to the target.

premium_proxy
boolean
default:false

Route the request through residential IPs. Required by most protected sites. Not allowed with mode=auto (400 REQS004).

proxy_country
string

Two-letter country code for the exit IP. Requires premium_proxy=true or mode=auto, which then routes through premium proxies, so the request costs at least 10 credits. Alone, or with only js_render, the request answers 400 REQS004.

Pattern: ^[a-z]{2}$
Example:

"us"

session_id
integer

Reuse the same IP across requests for up to 10 minutes. Any integer you choose identifies the session.

original_status
boolean
default:false

Return the target's own HTTP status code instead of the Zenrows one.

allowed_status_codes
string

Comma-separated status codes whose body should be returned instead of raising an error, for example 404,500.

wait_for
string

CSS selector to wait for before returning. Requires js_render.

wait
integer
default:0

Milliseconds to wait after load before returning. Requires js_render.

Required range: x >= 0
block_resources
string

Comma-separated resource types to block (for example image,media,font). Blocking is on by default.

json_response
string

Return a JSON envelope that also carries the network requests (XHR/fetch) the page made. Requires js_render=true or mode=auto; without either the request answers 400 REQS004.

css_extractor
string

JSON object mapping output keys to CSS selectors, applied to the retrieved page.

Example:

"{\"title\":\"h1\",\"price\":\".price\"}"

extract
enum<string>

Return structured JSON extracted from the page with no selectors to write (Extract). Omit it and Extract is off. auto and native return the website's own field names; standard returns a canonical schema shared by every website in a vertical (real estate only for now). Extract works on any prepared domain, with any active API key (prepare a new one with POST /extract/prepared-domains), and is currently free on top of the Fetch cost. A domain, or a kind of page on it, that is not prepared yet answers 403 REQS007: see requestExtractDomain.

Available options:
auto,
native,
standard
extract_fields
string

Comma-separated list of the fields extract should return, dot-notated for fields inside a group (for example products.name,products.price). Omit it to receive every field.

Example:

"products.name,products.price"

autoparse
boolean
default:false

Deprecated in favour of Extract (extract=auto). Returns general-purpose JSON parsed from the page, not tailored to the website.

response_type
enum<string>

Convert the page before returning it: Markdown, plaintext or PDF. pdf requires js_render=true; without it the request answers 400 REQS004. Any response_type together with outputs also answers 400 REQS004.

Available options:
markdown,
plaintext,
pdf
screenshot
boolean
default:false

Return an above-the-fold screenshot of the page. Requires js_render=true or mode=auto; without either the request answers 400 REQS004. Do not send it with outputs: the request answers 200 with no image and an empty outputs result.

screenshot_fullpage
boolean
default:false

Return a full-page screenshot. Requires js_render.

screenshot_selector
string

Screenshot only the element matching this CSS selector. Requires js_render.

screenshot_format
enum<string>
default:png

Screenshot image format.

Available options:
png,
jpeg
screenshot_quality
integer

JPEG quality, 1 to 100. Only with screenshot_format=jpeg.

Required range: 1 <= x <= 100
outputs
string

Comma-separated data types to pull out of the retrieved HTML (for example emails,phone_numbers). Not allowed with response_type (400 REQS004); with screenshot the request answers 200 with no image and an empty result.

Body

Forwarded to the target as is.

The body is of type object.

Response

The target's content, in the shape the request asked for: HTML by default, Markdown or plaintext with response_type, a PDF or PNG/JPEG binary for response_type=pdf and the screenshot parameters, and JSON for extract, css_extractor, autoparse or json_response.

The page as returned by the target.