Skip to main content
POST
Crawl a website and scrape its pages as markdown
Crawl a website and scrape its pages as markdown.

Request

url is required.

Response

If successful, the response body contains the standard envelope. data contains pagesRead, results and cursor. 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.
Set goal to read the pages about one topic first and stop when the site has no more about it. Use Web web Map to only list pages.

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 call reads up to 4 pages, up to 60 credits. Requests that fail, or that return no items, are not billed.

Pagination

Results are paginated. To retrieve the next page, pass the value of data.cursor as cursor in a subsequent request. A response that omits cursor is the last page.

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.

cursor
string

The cursor from the previous response. Send it as is.

Minimum string length: 1

Response

The data, and the credits this call used.

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