Batch scrape
POST /v2/batch/scrape
Copy page
Scrape many onion pages as one job, with the same options for each.
POST /
Authentication: your key as a bearer token.
Body
| Field | Type | Required | Default |
|---|---|---|---|
urls | string[] | Required | |
checkPromptInjection | boolean | null | Optional | |
excludeTags | string[] | Optional | [] |
formats | (string | object)[] | Optional | ["markdown"] |
formats[]. | string | Required | |
headers | object | Optional | {} |
ignoreInvalidURLs | boolean | Optional | true |
includeTags | string[] | Optional | [] |
maxAge | integer | null | Optional | |
maxConcurrency | integer | null | Optional | |
maxTextBytes | integer | null | Optional | |
onlyMainContent | boolean | Optional | true |
parsers | (string | object)[] | Optional | |
redactPII | boolean | object | Optional | |
render | string Values: auto, never, always | Optional | "auto" |
skipTlsVerification | boolean | Optional | false |
storeInCache | boolean | null | Optional | |
timeout | integer | null | Optional | |
waitFor | integer | Optional | 0 |
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 |
|---|---|
actions | Answers 400 NOT_IMPLEMENTED when not empty. |
appendToId | Answers 400 NOT_IMPLEMENTED when set. |
auditMetadata | Accepted and ignored. |
blockAds | Ignored, with a warning when not Firecrawl's default. |
domainTools | Accepted and ignored. |
fastMode | Ignored, with a warning when not Firecrawl's default. |
integration | Accepted and ignored. |
location | Ignored, with a warning when not Firecrawl's default. |
lockdown | Answers 400 BAD_REQUEST when true. |
minAge | Answers 400 BAD_REQUEST when set. |
mobile | Ignored, with a warning when not Firecrawl's default. |
onlyCleanContent | Ignored, with a warning when not Firecrawl's default. |
origin | Accepted and ignored. |
profile | Ignored, with a warning when not Firecrawl's default. |
proxy | Ignored, with a warning when not Firecrawl's default. |
removeBase64Images | Accepted and ignored. |
safeMode | Ignored, with a warning when not Firecrawl's default. |
threatProtection | Accepted and ignored. |
toolDetail | Accepted and ignored. |
useMock | Accepted and ignored. |
zeroDataRetention | Ignored, with a warning when not Firecrawl's default. |
Request
curl -X POST https://api.darkcrawl.dev/v2/batch/scrape \
-H "Authorization: Bearer $DARKCRAWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice","http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about"],"formats":["markdown","links"],"maxConcurrency":2}'import os
import requests
resp = requests.post(
"https://api.darkcrawl.dev/v2/batch/scrape",
headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
json={
"urls": ["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice", "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about"],
"formats": ["markdown", "links"],
"maxConcurrency": 2,
},
timeout=330,
)
print(resp.json())const resp = await fetch("https://api.darkcrawl.dev/v2/batch/scrape", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"urls": [
"http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice",
"http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/about"
],
"formats": [
"markdown",
"links"
],
"maxConcurrency": 2
}),
signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());Response
Status 200.
{
"success": true,
"id": "01K0EXAMPLEBATCH0000000000A",
"url": "https://api.darkcrawl.dev/v2/batch/scrape/01K0EXAMPLEBATCH0000000000A",
"invalidURLs": []
}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 |
NOT_IMPLEMENTED | 400 |
What each code means, and what to do about it: Errors.
Notes
urlsholds up to 1000 addresses. One that a scrape would refuse is left out and listed ininvalidURLs. WithignoreInvalidURLsset tofalse, any such address refuses the whole batch with400 BAD_REQUEST, anddetails.invalidURLslists them.- A batch reserves a page for each address, all or nothing: fewer pages left than addresses is
402 QUOTA_EXCEEDED. - The scrape options go at the top level, as on scrape. Links are never followed.
- 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.