POST
Fetch a page in one request. Use Try it to send a live request: set Authorization to Bearer <your API key>, then edit the fields below or use the full JSON example.
The playground sends requests to the URL in docs.json under api.mdx.server (for example https://api.scrapeswitch.com). The fields below map to the full POST /scrape JSON body so you can set or clear each parameter explicitly.

Request body

string
required
The target website URL that you want the API to scrape.
boolean
Whether JavaScript must run. Set true to force a headless browser instead of a plain HTTP fetch — useful for pages built with React, Angular, or Vue. Set false to forbid browser rendering. Omit it to let the adaptive strategy ladder decide.
string
Proxy cost tier to use directly: auto, basic, enhanced, or premium. Omitting it lets the strategy ladder escalate through tiers automatically as needed.
array
default:"[\"html\"]"
An array of one or more response formats to return. html is the raw page source. clean_html and markdown are cleaned/converted derivatives. links returns every link found on the page. json returns AI-extracted structured data — see prompt/schema below. screenshot and screenshot_full_page capture an image of the page (mutually exclusive with each other). Each requested format is returned under its own key in the response body (html_body, clean_html, links, markdown, json, screenshot, screenshot_full_page).
boolean
default:"true"
When true, strips navigation, footers, ads, and other non-main layout content from cleaned outputs (clean_html, markdown, json).
string
The country or region code (e.g., US, GB, DE) to route the request through. Useful for bypassing geo-blocks or viewing localized content.
string
A unique identifier to reuse the same proxy IP address across multiple requests. This is essential for scraping tasks that require logging in or maintaining a continuous user session.
string
A custom label (or array of labels) you can assign to the request for your own tracking and billing attribution in Request history. Not echoed back in the response body.
array
A list of simulated user interactions (like click, scroll, or type) to execute on the page after it loads, but before the data is extracted. Providing any actions forces browser rendering.
integer
Request timeout in milliseconds (1,000–60,000).
string
CSS selector to wait for before returning a browser-rendered page.
integer
Extra browser settle wait in milliseconds before returning (0–60,000).
object
Per-request overrides: headers, proxy, strategy, and browser flags.
string
A natural language instruction describing what to extract from the page. Used together with, or instead of, schema when output includes json. prompt or schema is required whenever output includes json. Max 16,384 characters.
object
A JSON schema defining the exact structure you want the AI-extracted data to return. Used together with, or instead of, prompt when output includes json. prompt or schema is required whenever output includes json. Max 65,536 bytes when serialized.

Response body

The response is a flat object — there is no separate internal-diagnostics wrapper:
string
Request id propagated from the request headers or generated by middleware.
string
Effective session id used for this scrape.
object
The proxy/browser geolocation actually used, when one was selected.
string
Final URL after redirects or browser navigation.
string
Site tier classification used by the orchestrator.
string
Proxy tier actually used for this request, when applicable.
integer
HTTP status observed for the winning attempt.
object
Output payload keyed by output type, such as html_body, clean_html, links, markdown, json, screenshot, or screenshot_full_page.