---
title: "Fetch the HTML (or parsed JSON) for any URL"
method: POST
path: "/getPageSource"
tags: ["Scraping"]
---

# Fetch the HTML (or parsed JSON) for any URL

`POST /getPageSource`

## Request

- Base URL: `https://api.scrapeunblocker.com`
- URL: `https://api.scrapeunblocker.com/getPageSource`
- Auth: API key in header `x-scrapeunblocker-key`

Routes the URL through the appropriate anti-bot bypass chain (site-specific handlers, real-browser rendering, rotating proxies). Returns the prettified HTML by default. Set `parsed_data=true` to receive a structured JSON payload extracted via Schema.org / __NEXT_DATA__ / AI-generated rules; the response body becomes `{ "data": { page_type, source, data } }` instead of HTML. Use `get_cookies=true` to additionally receive cookies and the proxy address that served the request.

## Query parameters

- `url` string, required
- `proxy_country` string
- `parsed_data` boolean
- `get_cookies` boolean
- `list_elements` boolean: Return the page's interactive elements (buttons, inputs, selects, links, forms) with ready-to-use selectors instead of HTML, to help build `steps`.
- `steps` string: JSON array of browser actions to run after the page loads (wait_for, wait_for_text, wait, click, type, select, press_key, scroll). The request is rendered in a real browser and runs once.

## Response `200`

Success — body is HTML (or JSON when `parsed_data=true` / `get_cookies=true`). With `parsed_data=true` a page that rendered but yielded no structured data is still a 200: `data.data` is empty, `data_extracted` is `false` and `html` carries the rendered page. Also a dead-origin 5xx page, as served (can be empty): then the `X-Origin-Status` header carries the target's status. The same for the target's own 401, 451 or empty 500, confirmed from more than one exit. A target that answers 204 (or another 2xx with no body) comes back as an empty 200. Billed.

- unknown

## Other responses

- `400`: Invalid URL, unsupported scheme or `proxy_country`, or `Hostname cannot be resolved` - the domain does not exist (billed).
- `403`: Blocked by bot protection on every available bypass path.
- `404`: The target itself answered 404 (the page does not exist). The body is the target's own page, as served (can be empty), and `X-Origin-Status: 404` tells it apart from a wrong API path. Billed - retrying returns the same answer.
- `410`: The target itself answered 410 (the page is gone). Same shape as 404: the target's page with `X-Origin-Status: 410`. Billed.
- `415`: The URL is not an HTML document (image, PDF, file); use /getImage for images. Not billed.
- `422`: Validation error. Not billed.
- `503`: No render capacity on our side right now; not the target's fault, not billed - retry with backoff.
- `504`: Request timed out: the call reached its time cap (60 s, 90 s with `steps`). Not billed.
- `523`: Origin unreachable (target down or flapping, or our origin breaker is open); not a bot block, not billed - retry later.

---

[API](https://skmtc.dev/scrapeunblocker/apis/scrapeunblocker-api.md) · [All operations](https://skmtc.dev/scrapeunblocker/apis/scrapeunblocker-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scrapeunblocker/apis/scrapeunblocker-api/revisions/c02f1254cc47?raw)
