Get any page as clean, usable content from the terminal, reliably, even if it’s dynamic, JavaScript-heavy, or protected.
zenrows fetch retrieves a single page and returns its HTML, Markdown, or plain text. It handles JavaScript rendering and anti-bot protection automatically, so most calls need no extra flags.
zenrows fetch <url> [flags]
Examples
# Just works, no flags neededzenrows fetch https://httpbin.io/html# Markdown outputzenrows fetch https://example.com --output markdown# Take manual control of rendering and proxieszenrows fetch https://example.com --manual --js-render --premium-proxy# Geo-target and wait for an elementzenrows fetch https://example.com --proxy-country us --wait-for ".price"# Save the response to a filezenrows fetch https://example.com --out page.html
Start with the defaults. Only add --manual --js-render --premium-proxy after a run’s trace (zenrows trace explain <run-id>) shows it’s actually needed, each flag raises cost.
Flags
Flag
Description
--manual
Take manual control of rendering and proxies instead of the automatic default
--js-render
Render JavaScript (manual mode only)
--premium-proxy
Use residential IPs (manual mode only)
--proxy-country <cc>
Geo-target. Works alone by default; in manual mode requires --premium-proxy
--wait <ms>
Fixed wait after load
--wait-for <selector>
Wait for a CSS selector
--js-instructions <json>
JSON instructions to run on the page
--session-id <n>
Keep the same IP across requests
--original-status
Return the target’s original HTTP status
--output <fmt>
html (default), markdown, text, or pdf
--screenshot
Capture an above-the-fold screenshot
--out <file>
Write the response body to a file
--timeout <ms>
Client-side timeout for each request, in milliseconds (default 200000, above the API’s 3-minute limit)
--retries <n>
Retry a 429, 502, 503 or 504, or a failure to connect, up to n times. Default 0: the request is sent once. See Retries
--no-signup
Do not auto-create a Free-plan account if no key exists
--json
Print a structured result instead of the raw body
Retries
zenrows fetch and zenrows extract send each request once by default. Pass --retries <n> (CLI 1.13.0 or later) to retry up to n times after:
A 429, 502, 503 or 504 from the API. None of these is charged.
A failure to connect: a refused connection, a name that did not resolve, a connect timeout or an unreachable network. The request never reached the API.
Its own timeout (--timeout), or any other network error, such as a connection that closed after the request was sent. The API may still finish that request and charge it.
Any status under --original-status, because the API then returns the target site’s own status.
zenrows extract prepare and prepare status.
Before each retry, the CLI waits the API’s Retry-After in whole seconds, from 0.25 s to 30 s. Otherwise it waits a random time from 0.25 s up to 1 s before the first retry, 2 s before the second, and so on, capped at 30 s. A retry starts only if its wait ends within 90 s of the first request. A running request is not cut short, so a command can take longer than that.If a 502, 503 or 504 is still the answer after the retries, the error is FETCH_FAILED, for example “The Zenrows API answered HTTP 503 after 2 retries.”, and it tells you to wait a minute and run the same command again. A 429 keeps its usual error. An invalid value, such as --retries -1, is an INVALID_USAGE error.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.