Menu

Crawl

Crawl parameters

Every field of a crawl request, the job it returns, and the results you poll for.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

Text
POST   https://api.millionshort.com/v1/crawl          start a crawl
GET    https://api.millionshort.com/v1/crawl          your team's crawls, newest first
GET    https://api.millionshort.com/v1/crawl/{id}     one crawl, with a page of its results
DELETE https://api.millionshort.com/v1/crawl/{id}     cancel

Request

FieldTypeDefaultNotes
urlstringRequired. Where the crawl starts: http or https, default ports, a host name (not an address), no credentials in the URL. Always crawled
max_pagesinteger, 1 to your plan's ceiling100, or the ceiling if it is lowerThe most pages charged: the pages that came back, plus any failed page that is charged (a page a browser mode found missing). Credits are held for this many, and a crawl never costs more than was held. See Limits of a plan
max_depthinteger, 0 to 103How many links away from the start page to go. 0 is that page alone. Sitemap URLs are depth 1
includearray of up to 20 patternsCrawl only URLs whose path matches one of these. The start page is crawled whatever they say
excludearray of up to 20 patternsNever crawl URLs whose path matches one of these. Wins over include
same_domainbooleantrueStay on the host you named. false also follows links to other sites
include_subdomainsbooleanfalseAlso crawl other hosts of the same site
sitemapinclude, skip, only"include"include: sitemap URLs and links. skip: links only. only: the start page and the sitemap's URLs, and links are not followed
modecached, live, rendered, unblock"live"How each page is obtained. See Modes
formatsarray of markdown, text, links, metadata["markdown","metadata"]What to return for each page, as for Extract
max_charsinteger, 1 to 100,00050000The longest content per page. Longer content is cut and truncated is true. Lower than Extract's 500,000, because a crawl keeps every page for a week
topics, page_types, source_hintsarrays of slugsKeep only the pages with these labels
jsonobject with schema and an optional promptEach page as JSON of your shape, on the plans that include it. Extract's limit of three URLs a call does not apply to a crawl; the daily limits on pages read as JSON do
remove_top_sitesinteger, 0 to 1,000,0000Only with same_domain: false: links to the N most popular sites are not followed
webhook_idstringAn active webhook endpoint of your team. It is told when the crawl ends

Any other field is a 400 INVALID_PARAM. A caller cannot send cookies, headers or a delay to a site, and there is no option to ignore robots.txt.

include and exclude are regular expressions on the path of a URL, not anchored, as for Map: /docs/ matches any path that contains it, ^/docs/ only paths that start with it.

An Idempotency-Key header is honoured for 24 hours: the same key with the same body returns the crawl it started, and the same key with another body is a 409 IDEMPOTENCY_CONFLICT.

Modes

PageHow it is obtainedCredits per page
A crawled page, liveFetched now, as our declared bot1
A crawled page, renderedLoaded in a browser, so content built by scripts appears. Paid plans2
A crawled page, unblockA rendered fetch for sites that refuse automated requests. Growth plan and above26
A crawled page, cachedThe copy we already hold. No page is requested from the site1

Scope

You sendHosts crawled
nothingThe host of url, with or without www.
include_subdomains: trueEvery host of the same site, such as docs.example.org and example.org
same_domain: falseAny host a crawled page links to

With same_domain: false, every other site is fetched under its own robots.txt and its own limits. remove_top_sites: 1000 then leaves out links to the 1,000 most popular sites, so a crawl does not wander off to the large platforms every page links to. When popularity cannot be looked up for a part of the crawl, no off-site link of that part is followed.

The crawl

POST answers 202 with the crawl. GET /v1/crawl/{id} and DELETE answer with the same object.

FieldTypeNotes
idstringStarts with crawl_
statusqueued, running, completed, cancelled, failed
url, mode, max_pages, max_depthAs the crawl runs them. max_pages is your plan's ceiling when the default was above it
totalintegerURLs found so far
completedintegerPages that came back
failedintegerURLs that were tried and gave no page. Free, except a page a browser mode found missing (see Pricing)
skippedintegerURLs found and never tried, once the crawl has ended
credits_heldnumberWhat was held when the crawl started
credits_usednumberWhat the crawl has been charged so far
stop_reasonstring or nullWhy the crawl ended. See Errors
unread_sourcesarray of sitemap, indexPresent when a list of URLs could not be read at the start. The crawl goes on with the links
webhook_idstring or null
created_at, finished_atdate-times
expires_atdate-time or nullWhen the results are deleted: 7 days after the crawl ended
errorobjectcode and message, on a crawl that failed

Poll

Example
Shell
curl https://api.millionshort.com/v1/crawl/$CRAWL_ID \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY"

GET /v1/crawl/{id} adds two fields to the crawl:

FieldTypeNotes
resultsarrayThe pages finished so far, in the order they finished, nearest the start first. Up to 50 at a time, and at most 4 MiB
nextstring or nullPass as ?cursor= to carry on from here. While the crawl runs it is set once any page has been read, even when no more pages are there yet; null before the first page has finished, and once the crawl has ended and its last page was read

Each result is an Extract result plus depth: its content in the formats you asked for, mode_used, the labels, and the site, popularity and risk of the page's site. A URL that failed has status: "error" and one of the per-URL codes.

Polling is free and does not count against the plan's requests a minute. It has its own limit of 120 a minute per team. usage.credits on a poll is what the crawl has been charged so far.

Example
Shell
curl "https://api.millionshort.com/v1/crawl?limit=20" \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY"

GET /v1/crawl lists your team's crawls, newest first, without results, in data.crawls. limit is 1 to 100 and defaults to 20. Free.

Cancel

Example
Shell
curl -X DELETE https://api.millionshort.com/v1/crawl/$CRAWL_ID \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY"

The crawl becomes cancelled. The pages that came back are kept and stay charged, and the rest of the hold is handed back. Cancelling a crawl that has ended changes nothing.

Events

With webhook_id, one event is delivered when the crawl ends: crawl.completed for a crawl that is completed or cancelled, crawl.failed for one that failed. It carries id, status, stop_reason, url, total, completed, failed and credits_used. It does not carry the pages: fetch them with GET /v1/crawl/{id}. Events are signed and retried as described on Webhooks.

How a crawl runs

Limits of a plan

FreeStarterGrowthScaleBusiness
max_pages, at most505002,00010,00025,000
Crawls open at once123510
renderedNoYesYesYesYes
unblockNoNoYesYesYes

A max_pages over the ceiling is a 400 INVALID_PARAM whose details.max is the ceiling (over 25,000, the highest ceiling, it is a plain 400 INVALID_PARAM). One crawl more than the plan may have open is a 429 RATE_LIMITED.

On one site the daily limit ends a crawl before a large ceiling does: a team gets 2,000 fetches of a site a day, sitemap files included, so a crawl of one site stops with stop_reason: "site_daily_limit" at about 2,000 pages, whatever the plan.

Credits

A crawled page costs 1 credit in cached and live, 2 in rendered and 26 in unblock, charged for the pages that came back. A URL that fails is free, with one exception in the browser modes. Pricing and limits has the table and examples.

This page as Markdown · llms.txt