Menu

Crawl

Crawl quickstart

Start a crawl, poll it, read the pages, and cancel one you no longer need.

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

1. Start a crawl

Example
Shell
curl https://api.millionshort.com/v1/crawl \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.org/docs",
    "max_pages": 50,
    "include": ["^/docs/"]
  }'

The answer is 202 with the job. Nothing has been fetched yet:

JSON
{
  "data": {
    "id": "crawl_01jd3v9x7k2m4n6p8q0r2s4t6v",
    "status": "queued",
    "url": "https://example.org/docs",
    "mode": "live",
    "max_pages": 50,
    "max_depth": 3,
    "total": 1,
    "completed": 0,
    "failed": 0,
    "skipped": 0,
    "credits_held": 50,
    "credits_used": 0,
    "stop_reason": null,
    "webhook_id": null,
    "created_at": "2026-11-20T10:00:00Z",
    "finished_at": null,
    "expires_at": null
  },
  "usage": null,
  "warnings": [],
  "request_id": "req_..."
}

credits_held is the price of max_pages pages in the mode you chose. A team that cannot cover it gets 429 INSUFFICIENT_CREDITS and nothing starts. What the crawl does not use is handed back when it ends.

2. Poll it

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

Polling is free and does not count against your plan's requests a minute. status goes from queued to running to completed, cancelled or failed. completed counts the pages that came back, failed the URLs that were tried and gave no page, and total the URLs found so far.

A crawl of one site takes its time on purpose: about one page every two seconds for one account. Fifty pages take about two minutes, and a large crawl takes hours. The SDKs have a waiter that polls for you, every 5 seconds: wait_crawl in Python and waitCrawl in TypeScript.

3. Read the pages

The poll carries the pages finished so far in results, up to 50 at a time, nearest the start first. Each one is an Extract result with a depth. Two of this crawl's 14 results are shown here:

JSON
{
  "data": {
    "id": "crawl_01jd3v9x7k2m4n6p8q0r2s4t6v",
    "status": "completed",
    "url": "https://example.org/docs",
    "mode": "live",
    "max_pages": 50,
    "max_depth": 3,
    "total": 14,
    "completed": 12,
    "failed": 2,
    "skipped": 0,
    "credits_held": 50,
    "credits_used": 12,
    "stop_reason": "no_more_pages",
    "webhook_id": null,
    "created_at": "2026-11-20T10:00:00Z",
    "finished_at": "2026-11-20T10:00:41Z",
    "expires_at": "2026-11-27T10:00:41Z",
    "results": [
      {
        "depth": 0,
        "url": "https://example.org/docs",
        "final_url": "https://example.org/docs",
        "status": "ok",
        "mode_used": "live",
        "fetched_at": "2026-11-20T10:00:03Z",
        "age_seconds": 0,
        "format": "markdown",
        "title": "Documentation",
        "markdown": "# Documentation\n\nStart here...",
        "truncated": false,
        "topic": "software",
        "page_type": "documentation",
        "source_hint": "web",
        "label_confidence": { "topic": 0.81, "page_type": 0.9, "source_hint": 0.9 },
        "site": "example.org",
        "popularity": { "rank": null, "bucket": "long-tail" },
        "risk": null
      },
      {
        "depth": 1,
        "url": "https://example.org/docs/internal",
        "status": "error",
        "error": {
          "code": "ROBOTS_DISALLOWED",
          "message": "This site's robots.txt does not allow our bot to fetch this page."
        }
      }
    ],
    "next": null
  },
  "usage": { "credits": 12, "cost_usd": 0.012, "breakdown": {} },
  "request_id": "req_..."
}

Results are kept for 7 days after the crawl ended. expires_at says until when.

4. Cancel

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

The pages that came back are kept and stay charged. The rest of the hold is handed back. The SDK methods are cancel_crawl in Python and cancelCrawl in TypeScript.

Next

This page as Markdown · llms.txt