Crawl
POST /v2/crawl
Copy page
Start a crawl of one onion site. It returns a job id to read.
POST /
Authentication: your key as a bearer token.
Body
| Field | Type | Required | Default |
|---|---|---|---|
url | string | Required | |
allowExternalLinks | boolean | Optional | false |
allowSubdomains | boolean | Optional | false |
crawlEntireDomain | boolean | Optional | false |
deduplicateSimilarURLs | boolean | Optional | true |
delay | number | null | Optional | |
excludePaths | string[] | Optional | [] |
ignoreQueryParameters | boolean | Optional | false |
ignoreRobotsTxt | boolean | Optional | false |
includePaths | string[] | Optional | [] |
limit | integer | Optional | 10000 |
maxConcurrency | integer | null | Optional | |
maxDiscoveryDepth | integer | null | Optional | |
maxPagesPerPattern | integer | null | Optional | |
regexOnFullURL | boolean | Optional | false |
scrapeOptions | object | null | Optional | |
scrapeOptions. | boolean | null | Optional | |
scrapeOptions. | string[] | Optional | [] |
scrapeOptions. | (string | object)[] | Optional | ["markdown"] |
scrapeOptions. | object | Optional | {} |
scrapeOptions. | string[] | Optional | [] |
scrapeOptions. | integer | null | Optional | |
scrapeOptions. | boolean | Optional | true |
scrapeOptions. | (string | object)[] | Optional | |
scrapeOptions. | boolean | object | Optional | |
scrapeOptions. | string Values: auto, never, always | Optional | "auto" |
scrapeOptions. | boolean | Optional | false |
scrapeOptions. | integer | null | Optional | |
scrapeOptions. | integer | Optional | 0 |
sitemap | string Values: skip, include, only | Optional | "include" |
webhook | string | object | null | Optional | |
webhook. | string | Required | |
webhook. | string[] | null Values: started, page, completed, failed, crawl.started, crawl.page, crawl.completed, crawl.failed, batch_scrape.started, batch_scrape.page, batch_scrape.completed, batch_scrape.failed | Optional | |
webhook. | object | null | Optional | |
webhook. | object | null | Optional |
Firecrawl compatibility fields
Firecrawl fields DarkCrawl does not offer. It takes them so the Firecrawl SDKs keep working, then ignores or refuses each one as the table says.
| Field | What DarkCrawl does |
|---|---|
integration | Accepted and ignored. |
origin | Accepted and ignored. |
prompt | Ignored, with a warning when set. |
robotsUserAgent | Ignored, with a warning when set. |
scrapeOptions.actions | Answers 400 NOT_IMPLEMENTED when not empty. |
scrapeOptions.auditMetadata | Accepted and ignored. |
scrapeOptions.blockAds | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.domainTools | Accepted and ignored. |
scrapeOptions.fastMode | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.integration | Accepted and ignored. |
scrapeOptions.location | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.lockdown | Answers 400 BAD_REQUEST when true. |
scrapeOptions.maxAge | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.minAge | Answers 400 BAD_REQUEST when set. |
scrapeOptions.mobile | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.onlyCleanContent | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.origin | Accepted and ignored. |
scrapeOptions.profile | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.proxy | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.removeBase64Images | Accepted and ignored. |
scrapeOptions.safeMode | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.storeInCache | Ignored, with a warning when not Firecrawl's default. |
scrapeOptions.threatProtection | Accepted and ignored. |
scrapeOptions.toolDetail | Accepted and ignored. |
scrapeOptions.useMock | Accepted and ignored. |
scrapeOptions.zeroDataRetention | Ignored, with a warning when not Firecrawl's default. |
zeroDataRetention | Ignored, with a warning when set. |
Request
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}'import os
import requests
resp = requests.post(
"https://api.darkcrawl.dev/v2/crawl",
headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
json={
"url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice",
"limit": 20,
},
timeout=330,
)
print(resp.json())const resp = await fetch("https://api.darkcrawl.dev/v2/crawl", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice",
"limit": 20
}),
signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());Response
Status 200.
{
"success": true,
"id": "01K0EXAMPLEJOB00000000000A",
"url": "https://api.darkcrawl.dev/v2/crawl/01K0EXAMPLEJOB00000000000A"
}Errors
| Code | Status |
|---|---|
BAD_REQUEST | 400 |
INVALID_ONION | 400 |
POLICY_FORBIDDEN | 400 |
BLOCKLISTED | 403 |
BLOCKLIST_UNAVAILABLE | 503 |
SECRETS_UNAVAILABLE | 503 |
AI_UNAVAILABLE | 503 |
QUOTA_EXCEEDED | 402 |
RATE_LIMITED | 429 |
What each code means, and what to do about it: Errors.
Notes
- A
limitabove the plan's crawl maximum is lowered to it, and alimitabove the pages you have left is lowered again. The job'swarningsays so. With no pages left, nothing starts. - Poll
urlfor the job.expiresAtin its status says when the job's listing expires. - The call reserves the job's pages before it stores anything, and charges the pages the job read when it ends. Rate limits has what can refuse it.
- A
webhooksends the job's events to your receiver, which must behttps. See Webhooks.