Skip to content

SDKs

Plain HTTP

Copy page

Call DarkCrawl with any HTTP client. One JSON envelope for every reply, and one for every error.

Any client that sends JSON works. Send your key as a bearer token in the Authorization header, and the body as application/json. The hosted API is 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 DARKCRAWL_API_KEY. The guides show a request for each endpoint, and the API Reference lists every route.

A reply is JSON. A success holds "success": true and, for most routes, the result in data. Job routes answer with an id, and a status route answers with the job’s status.

An error uses Firecrawl’s envelope:

  • success is false.
  • code is a short code such as UNAUTHORIZED or RATE_LIMITED.
  • error is one line of text.
  • details, when there is one, holds fields such as field or reason.

Errors never include page content or stack traces. Errors lists the codes.

A request over a limit of your plan answers 429 RATE_LIMITED, with a Retry-After header in seconds, or 402 QUOTA_EXCEEDED. The limits are on Rate limits.

Every request goes over Tor, so a page can take a while to answer. Set your client’s timeout above the request’s own timeout. The samples add 30 seconds. Working with onion sites says what to expect.