Skip to main content

Fetch a page and return its content

POST 

/v1/extract

Fetches one URL and returns the representations you ask for. Accepts JSON or form-encoded bodies (application/x-www-form-urlencoded); the same field names apply to both.

Request body​

11 of 11
urlstringrequired
The page to fetch. The host, every redirect hop and every resolved address must be public — loopback, private, link-local and reserved ranges are rejected.
Values
absolute http/https URL
formatsstring[]
Which representations to produce. Only the keys you ask for are returned.
Default
["markdown"]
Values
markdown, raw_html, clean_html, links (no duplicates)
only_main_contentboolean
Keep the article body only, dropping navigation, footers and sidebars.
Default
true
include_tagsstring[]
Keep only nodes matching these selectors.
Values
CSS selectors
exclude_tagsstring[]
Remove matching nodes. If this removes all body text the call returns 400 EXTRACTION_SELECTION_EMPTY — adjust the selectors and retry.
Values
CSS selectors
max_age_msinteger
How old a cached snapshot may be. 0 forces a fresh fetch.
Default
172800000 (2 days)
Values
0 … 172800000
headersobject<string,string>
Headers forwarded to the target site. Host and hop-by-hop headers are rejected. See the cache-isolation side effect in the introduction.
Values
e.g. {"Accept-Language":"en-US"}
wait_for_msinteger
Extra wait after the page has loaded.
Default
0
Values
0 … 30000, and at most half of timeout_ms
timeout_msinteger
Budget for the whole call: validation, fetch, rendering and extraction.
Default
60000
Values
1000 … 120000
countrystring
Access region. A well-formed code outside the list is rejected.
Default
US
Values
two letters from the supported egress regions
advanced_modeboolean
true lets the fetch service escalate based on page signals; false keeps it on the direct engine. This is the supported way to ask for rendering.
Default
true

render_js is deliberately not accepted: it is the platform's paid browser troubleshooting switch. Sending it returns 400 with code 11000.

Reading the result​

  • data.success is the call's real outcome (see the introduction).
  • data.outputs contains exactly the formats you requested; a requested-but-empty markdown is "", an unproducible one is null.
  • data.meta.strategy_used is X1 / X2 / X3 and drives the price; data.meta.cache_hit tells you whether a snapshot was reused.
  • data.meta.result.status_code is the target site's status and may be null when the fetch service could not observe one — it is not this API's status code.

Request​

Responses​

Either a retrieved page or a platform-level failure inside data (data.success: false).

Response Headers
    Cache-Control

    Always no-store — no intermediary may cache these responses.

    X-Upstream-Request-Id

    The fetch service's own request identifier for this call. Quote it together with the envelope's request_id in support requests.