Skip to content

API Reference

Authentication

Copy page

Send your key as a bearer token on every call, and read a refused key.

Every call needs your key, except GET /health. Send it as a bearer token in the Authorization header, to https://api.darkcrawl.dev:

bash
curl -X POST https://api.darkcrawl.dev/v2/scrape \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice","formats":["markdown","links"],"onlyMainContent":true,"timeout":120000}'

The samples read the key from the DARKCRAWL_API_KEY environment variable. Keep it there, or in your secret store, and not in your code.

A key starts with dc_ and belongs to one company. Every key of a company shares that company’s plan, and its limits are on Rate limits. Access is by application, and a person reads each one. Get a key says how to apply, how to make a key, and who in your company can see it.

DarkCrawl reads the key from the Authorization header and from nowhere else. Never put a key in an address, such as a query string or a path: it does nothing there, and addresses end up in logs, proxies and browser history.

A key that is missing, wrong, revoked, or from a closed company gets one answer, 401 UNAUTHORIZED, so nobody can use it to tell which of those it was.

Response
{
  "success": false,
  "code": "UNAUTHORIZED",
  "error": "Unauthorized"
}

Check that the header reads Authorization: Bearer and then the whole key, with no quotes around it. If the header is right, the key is wrong or was revoked. Make a new one: see Get a key.

A key that is accepted can still be refused because of the company’s standing. A company whose trial has ended gets 403 TRIAL_EXPIRED, a company that has been suspended gets 403 ORG_SUSPENDED, and a company that has been disabled gets 403 ORG_DISABLED: its calls are refused until access is restored. Errors lists every code.

A Firecrawl SDK takes the key as its API key and DarkCrawl’s address as its API URL, and sends the same header for you. See SDKs.