Skip to content

Guides

Crawl

Copy page

Read an onion site page by page as one job, then read the job's status and pages.

POST /v2/crawl starts a job that reads a site page by page. It answers at once with the job’s id; you read the pages with the status route.

bash
curl -X POST https://api.darkcrawl.dev/v2/crawl \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice","limit":20}'
Response
{
  "success": true,
  "id": "01K0EXAMPLEJOB00000000000A",
  "url": "https://api.darkcrawl.dev/v2/crawl/01K0EXAMPLEJOB00000000000A"
}

GET /v2/crawl/{job_id} answers with the job’s status (scraping, completed, failed or cancelled), completed and total pages, expiresAt and data, a list of pages shaped like a scrape reply. Poll it until status is no longer scraping.

bash
curl https://api.darkcrawl.dev/v2/crawl/JOB_ID \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"
Response
{
  "success": true,
  "status": "completed",
  "completed": 2,
  "total": 2,
  "creditsUsed": 0,
  "expiresAt": "2026-12-26T10:00:00+00:00",
  "loginWalls": 0,
  "data": [
    {
      "markdown": "# Notice\n\nSample page text.\n\nContact: sales@example.invalid\n",
      "links": [
        "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about",
        "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/contact"
      ],
      "metadata": {
        "title": "Notice",
        "description": "",
        "language": "en",
        "sourceURL": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice",
        "url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice",
        "statusCode": 200,
        "contentType": "text/html",
        "scrapeId": "01K0EXAMPLECAPTURE0000000A",
        "onion": {
          "host": "exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion",
          "valid": true,
          "version": 3
        },
        "evidence": {
          "captureId": "01K0EXAMPLECAPTURE0000000A",
          "fetchedAt": "2026-11-26T10:00:00+00:00",
          "sha256Raw": "9f2c000000000000000000000000000000000000000000000000000000000000"
        }
      },
      "indicators": [
        {
          "type": "email",
          "value": "sales@example.invalid",
          "count": 1
        }
      ],
      "resources": [
        {
          "category": "image",
          "element": "img",
          "url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/logo.png",
          "label": "Logo",
          "title": "",
          "filename": "logo.png",
          "type": "image/png",
          "size": null,
          "download": {
            "status": "metadata_only"
          }
        }
      ]
    },
    {
      "markdown": "# About\n\nSample second page.\n",
      "links": [
        "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/"
      ],
      "metadata": {
        "title": "About",
        "description": "",
        "language": "en",
        "sourceURL": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about",
        "url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about",
        "statusCode": 200,
        "contentType": "text/html",
        "scrapeId": "01K0EXAMPLECAPTURE0000000B",
        "onion": {
          "host": "exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion",
          "valid": true,
          "version": 3
        },
        "evidence": {
          "captureId": "01K0EXAMPLECAPTURE0000000A",
          "fetchedAt": "2026-11-26T10:00:00+00:00",
          "sha256Raw": "9f2c000000000000000000000000000000000000000000000000000000000000"
        }
      },
      "indicators": [
        {
          "type": "email",
          "value": "sales@example.invalid",
          "count": 1
        }
      ],
      "resources": [
        {
          "category": "image",
          "element": "img",
          "url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/logo.png",
          "label": "Logo",
          "title": "",
          "filename": "logo.png",
          "type": "image/png",
          "size": null,
          "download": {
            "status": "metadata_only"
          }
        }
      ]
    }
  ]
}

A reply holds at most 100 documents or about 10 MiB. When more are left, next is the address of the following part, and ?skip=&limit= pages by hand. expiresAt says when the job’s listing expires.

DELETE /v2/crawl/{job_id} stops a job. An unknown job answers 404, and a finished one 409.

bash
curl -X DELETE https://api.darkcrawl.dev/v2/crawl/JOB_ID \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"
Response
{
  "status": "cancelled"
}

url is required. Everything else is optional.

Option What it does
limit The most pages to read. A plan can lower it, with a warning in the reply.
maxDiscoveryDepth How many links deep to follow.
includePaths, excludePaths Regular expressions on the path, or on the whole URL with regexOnFullURL.
crawlEntireDomain, allowSubdomains Widen what counts as the same site.
allowExternalLinks Follow links to other onion hosts only. Each is still checked.
ignoreQueryParameters, deduplicateSimilarURLs Treat near-identical URLs as one.
delay, maxConcurrency Pace the reads.
sitemap include, only or skip.
ignoreRobotsTxt Whether to ignore the site’s robots.txt.
maxPagesPerPattern DarkCrawl’s own. Caps how many pages one URL template may produce, so a crawler trap cannot use up the job.
scrapeOptions The scrape options, applied to every page.
webhook Send the job’s events to your receiver. See Webhooks.

prompt, robotsUserAgent and zeroDataRetention are accepted and ignored, with a warning. In scrapeOptions, maxAge and storeInCache are ignored too: a crawl always reads fresh.

A crawl keeps going after a restart. A page that was in flight is read again, and each page is counted once.

GET /v2/crawl/{job_id}/errors lists the pages a job could not read, with a code and a short error for each, and the pages robots.txt told it to skip.

Starting a crawl counts as one request and reserves its pages, up to limit. The pages it reads are charged when it ends and the rest is released. A crawl can reach the plan’s requests, pages, jobs running at once and pages per crawl. A status read is not a request, but it has a limit of its own. The values are on Rate limits.