Skip to main content
POST
Scrape any public web page as markdown, HTML, links or a screenshot
Scrape any public web page as markdown, HTML, links or a screenshot.

Request

url is required.
This endpoint can be called without an API key, subject to per-address limits. Pagination requires a key.

Response

If successful, the response body contains the standard envelope. data contains markdown, html, rawHtml, links, screenshot, isTruncated and metadata. The following example is a real response, truncated: each list shows one item and long strings are cut.
Social, video, shopping and jobs pages have their own endpoints with structured data.

Optional parameters

Billing

A successful request consumes 1 credit for most pages. 2 or 3 credits when a page takes more work to load, and 15 credits for the hardest pages to reach. A read with a screenshot, actions or waitFor costs 3 credits, or 15 on the hardest pages to reach. An answer from a stored copy costs 1 credit. A page that cannot be read costs nothing. creditsUsed shows what the call cost, up to 15 credits. Requests that fail, or that return no items, are not billed.

Pagination

This method is not paginated. A single request returns the complete result.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

maxTextLength
integer

Cut every text value in the response to this many characters. A value that was cut ends with …, and a page whose text was cut has isTruncated set to true. A screenshot is never cut. Leave it out to get the full text.

Required range: x >= 1

Body

application/json
url
string
required

The page or PDF to read, such as https://bun.com/docs.

formats
(enum<string> | object)[]

What to return: markdown (clean page text), html (the cleaned page), rawHtml (the page as sent), links (every link on the page) and screenshot (a JPEG of the visible page, as base64). Send { "type": "screenshot", "fullPage": true } for the whole page. A screenshot costs 3 credits, or 15 on the hardest pages to reach. A PDF comes back as markdown only.

Required array length: 1 - 5 elements
Available options:
markdown,
html,
rawHtml,
links,
screenshot
onlyMainContent
boolean
default:true

Keep only the page's main content, without menus, headers, footers and ads.

includeTags
string[]

Keep only the parts of the page that match these CSS selectors, such as article or .price. When set, onlyMainContent is not applied.

Required array length: 1 - 20 elements
Required string length: 1 - 200
excludeTags
string[]

Remove the parts of the page that match these CSS selectors, such as .comments.

Required array length: 1 - 20 elements
Required string length: 1 - 200
waitFor
integer

Extra milliseconds to wait before reading, for pages that load their content late. To wait for an element, add a wait action with a selector. A read that waits costs 3 credits, or 15 on the hardest pages to reach.

Required range: 0 <= x <= 10000
timeout
integer
default:30000

How long to keep trying, in milliseconds. Pages behind a bot check can need 10 to 30 seconds the first time.

Required range: 10000 <= x <= 60000
maxAge
integer
default:3600000

Accept a stored answer up to this many milliseconds old. 0 always reads the page live. metadata.cacheState says which one you got.

Required range: 0 <= x <= 172800000
location
object

Where to read the page from. The default is the United States.

actions
object[]

Steps to run on the page, in order, before reading it: { "type": "wait", "milliseconds": 500 }, { "type": "wait", "selector": ".results" }, { "type": "click", "selector": "button.more" }, { "type": "write", "text": "tides" }, { "type": "press", "key": "Enter" } or { "type": "scroll", "direction": "down" }. A read with actions costs 3 credits, or 15 on the hardest pages to reach.

Required array length: 1 - 20 elements
maxChars
integer

Cut the markdown at this many characters; isTruncated says when that happened.

Required range: 500 <= x <= 1000000

Response

The data, and the credits this call used.

success
any
required
data
object
required
creditsUsed
integer
required
requestId
string
required