POST/v2/scrape

An API key is optional; without one the caller is anonymous.

Request body

application/json, required, type ScrapeRequest

requestOptionsRequestOptions

Options for the request sent to the URL.

1 field inside requestOptions
headersarray of RequestHeader or null

Headers to send, in this order and exactly as written. Omit to use the defaults. Redirect hops also carry the cookies the site sets. With headers, redirects to another site are not followed.

2 fields inside headers
namestringrequired

The header name.

at least 1 characters

valuestringrequired

The header value.

responseOptionsResponseOptions

Options for the content returned for the URL.

2 fields inside responseOptions
formatstring

The format to return the page in.

One of html, markdown

Default html

onlyMainContentboolean

Return only the page's main content, without navigation, headers and footers.

Default false

timeoutinteger (int64)

Maximum time to wait, in milliseconds.

Default 10000

minimum 1000, maximum 20000

urlstringrequired

The URL to scrape.

at least 1 characters

Responses

OK

Type ScrapeResponse

dataDocumentrequired
3 fields inside data
htmlstring

The page HTML, converted to UTF-8; only its main content with responseOptions.onlyMainContent.

markdownstring

The page as Markdown.

metadataDocumentMetadatarequired
6 fields inside metadata
contentTypestring

The response content type.

errorstring

Why the scrape failed.

errorCodestring

A machine-readable error code.

sourceURLstringrequired

The requested URL.

statusCodeinteger (int64)

The HTTP status code.

urlstringrequired

The final URL after redirects.

successbooleanrequired

Always true.

One of true