Skip to main content
POST
Crawl a website
1 credit per page Rate limit weight: 10 See the guide for examples and usage.
Need to crawl more than 500 pages? Use batches.

Authorizations

Authorization
string
header
required

Send your API key as Authorization: Bearer <API_KEY>. Keys have full access unless restricted to specific permissions.

Body

application/json
url
string<uri>
required

Start URL, including http:// or https://.

Minimum string length: 1
maxPages
integer
default:100

Maximum number of pages to crawl.

Required range: 1 <= x <= 500
maxDepth
integer

Maximum link depth from the start URL. 0 crawls only the start URL. Omit for no depth limit.

Required range: x >= 0
urlRegex
string

Only follow and scrape URLs matching this regex. A prefix pattern of the form ^<start URL> also follows a redirect of the start page.

Maximum string length: 256
Example:

"^https?://[^/]+/blog/"

excludeUrlRegex
string

Never follow or scrape URLs matching this regex, even when they match urlRegex. The start URL is always scraped.

Maximum string length: 256
Example:

"/tag/|/author/"

Keep link URLs in the Markdown (html-conversion only).

includeImages
boolean
default:false

Include image references in the Markdown (html-conversion only).

shortenBase64Images
boolean
default:true

Shorten inline base64 image data (html-conversion only).

useMainContentOnly
boolean
default:false

Keep only the main content, without navigation, headers, footers, or sidebars.

sourcePreference
enum<string>[]

Markdown sources in order of preference: html-conversion converts the page HTML, markdown-direct uses Markdown the site publishes.

Minimum array length: 1
Available options:
html-conversion,
markdown-direct
followSubdomains
boolean
default:false

Follow links to subdomains of the start URL's domain, such as docs.example.com from example.com. www and the apex domain always count as the same site.

pdf
object

Whether to parse PDFs and which pages to read.

includeFrames
default:auto

Which iframe contents to include in each page's Markdown. auto inlines only iframes that hold page content, such as same-site documents, framesets, job boards, forms, and embedded documents, and skips ads and widgets. true inlines every iframe; false inlines none.

includeSelectors
string[] | null

Keep only elements matching these CSS selectors.

Maximum array length: 50
Required string length: 1 - 2048
excludeSelectors
string[] | null

Remove elements matching these CSS selectors. Overrides includeSelectors.

Maximum array length: 50
Required string length: 1 - 2048
maxAgeMs
integer | null
default:86400000

Maximum age of a cached result, in milliseconds. 0 always fetches fresh. Defaults to 1 day (86400000 ms). Maximum: 30 days (2592000000 ms).

Required range: 0 <= x <= 2592000000
waitForMs
integer | null
default:3500

Time to wait after each page loads before reading it, in milliseconds. 0 waits 500 ms. timeoutOpts.milliseconds must be at least waitForMs plus 10000 ms, or the request fails with TIMEOUT_TOO_SHORT_FOR_WAIT.

Required range: 0 <= x <= 30000
settleAnimations
boolean
default:false

Wait briefly for CSS animations and transitions to settle before reading each page.

stopAfterMs
integer
default:80000

Soft time budget for the crawl, in milliseconds. When it runs out, the crawl returns the pages collected so far. Larger values are capped at 110 seconds.

Required range: 10000 <= x <= 110000
country
enum<string>

Country to fetch from, as an ISO 3166-1 alpha-2 code.

Available options:
ad,
ae,
af,
ag,
ai,
al,
am,
ao,
ar,
at,
au,
aw,
az,
ba,
bb,
bd,
be,
bf,
bg,
bh,
bi,
bj,
bm,
bn,
bo,
bq,
br,
bs,
bw,
by,
bz,
ca,
cd,
cf,
cg,
ch,
ci,
cl,
cm,
cn,
co,
cr,
cv,
cw,
cy,
cz,
de,
dj,
dk,
dm,
do,
dz,
ec,
ee,
eg,
es,
et,
fi,
fj,
fr,
ga,
gb,
gd,
ge,
gf,
gg,
gh,
gm,
gn,
gp,
gq,
gr,
gt,
gu,
gw,
gy,
hk,
hn,
hr,
ht,
hu,
id,
ie,
il,
im,
in,
iq,
ir,
is,
it,
je,
jm,
jo,
jp,
ke,
kg,
kh,
kn,
kr,
kw,
ky,
kz,
la,
lb,
lc,
lk,
lr,
ls,
lt,
lu,
lv,
ly,
ma,
mc,
md,
me,
mf,
mg,
mk,
ml,
mm,
mn,
mo,
mq,
mr,
mt,
mu,
mv,
mw,
mx,
my,
mz,
na,
nc,
ne,
ng,
ni,
nl,
no,
np,
nz,
om,
pa,
pe,
pf,
pg,
ph,
pk,
pl,
pr,
ps,
pt,
py,
qa,
re,
ro,
rs,
ru,
rw,
sa,
sc,
sd,
se,
sg,
si,
sk,
sl,
sm,
sn,
so,
sr,
ss,
st,
sv,
sx,
sy,
sz,
tc,
td,
tg,
th,
tj,
tl,
tm,
tn,
tr,
tt,
tw,
tz,
ua,
ug,
us,
uy,
uz,
vc,
ve,
vg,
vi,
vn,
ye,
yt,
za,
zm,
zw
Example:

"de"

timeoutOpts
object

Request deadline and what to return when it passes.

zdr
enum<string>
default:disabled

enabled turns on zero data retention. Returns 403 ZDR_NOT_ENABLED unless your organization has ZDR.

Available options:
enabled,
disabled
tags
string[]

Labels for this request. Filter usage and request logs by them in the dashboard or with GET /org/logs.

Maximum array length: 20
Required string length: 1 - 50
Example:
policies
string[]

Access policy IDs to apply; each URL must pass all of them. Requires access policies enabled for your organization; otherwise returns ACCESS_POLICIES_NOT_ENABLED.

Example:

Response

Crawled pages with Markdown and metadata.

results
object[]
required
metadata
object
required
cache_metadata
object
required

Cache status of this response.

request_id
string<uuid>
required

Unique ID of this request, also in X-Request-Id. Include it when contacting support.

Example:

"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"

partial
boolean

true when the deadline passed with timeoutOpts.behavior set to return-partial. Only results finished in time are included. Partial results are not cached.

key_metadata
object

Credits this request used and your remaining balance.