Skip to main content
POST
Crawl a website in the background
Crawl a website in the background.

Request

url is required.

Response

If successful, the response body contains the standard envelope. data contains id, status and total. The following example is a real response, truncated: each list shows one item and long strings are cut.
For every field, see the response schema on this page.
It answers at once with an id; ask Web web Crawl Status for the pages, or send webhook to be told as each one finishes.

Optional parameters

Billing

A successful request consumes 1 credit a page 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 page that cannot be read costs nothing. Each page is charged when it finishes. Starting the job is free, up to 15000 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 to start from, such as https://bun.com/docs.

goal
string

What you are looking for, such as sqlite performance. Pages about it are read first, and the crawl stops once new pages stop mentioning it.

Required string length: 1 - 300
includePaths
string[]

Read only pages whose path matches one of these, such as /blog/*.

Maximum array length: 20
Required string length: 1 - 200
excludePaths
string[]

Skip pages whose path matches one of these, such as /tag/*.

Maximum array length: 20
Required string length: 1 - 200
maxDepth
integer
default:3

How many links away from the start page to go.

Required range: 1 <= x <= 10
maxPages
integer
default:100

Stop after reading this many pages in total, across every call.

Required range: 1 <= x <= 1000
entireSite
boolean
default:false

Read the whole site, not only pages under the start page's path.

includeSubdomains
boolean
default:false

Also read pages on subdomains, such as docs.bun.com for bun.com.

onlyMainContent
boolean
default:true

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

webhook
string

A public address that gets a JSON POST when the job starts, for each finished page, and when the job ends.

Response

The data, and the credits this call used.

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