Skip to content

Crawl

POST /v2/crawl

Copy page

Start a crawl of one onion site. It returns a job id to read.

POST /v2/crawl

Authentication: your key as a bearer token.

Body

FieldTypeRequiredDefault
urlstringRequired
allowExternalLinksbooleanOptionalfalse
allowSubdomainsbooleanOptionalfalse
crawlEntireDomainbooleanOptionalfalse
deduplicateSimilarURLsbooleanOptionaltrue
delaynumber | nullOptional
excludePathsstring[]Optional[]
ignoreQueryParametersbooleanOptionalfalse
ignoreRobotsTxtbooleanOptionalfalse
includePathsstring[]Optional[]
limitintegerOptional10000
maxConcurrencyinteger | nullOptional
maxDiscoveryDepthinteger | nullOptional
maxPagesPerPatterninteger | nullOptional
regexOnFullURLbooleanOptionalfalse
scrapeOptionsobject | nullOptional
scrapeOptions.checkPromptInjectionboolean | nullOptional
scrapeOptions.excludeTagsstring[]Optional[]
scrapeOptions.formats(string | object)[]Optional["markdown"]
scrapeOptions.headersobjectOptional{}
scrapeOptions.includeTagsstring[]Optional[]
scrapeOptions.maxTextBytesinteger | nullOptional
scrapeOptions.onlyMainContentbooleanOptionaltrue
scrapeOptions.parsers(string | object)[]Optional
scrapeOptions.redactPIIboolean | objectOptional
scrapeOptions.renderstring Values: auto, never, alwaysOptional"auto"
scrapeOptions.skipTlsVerificationbooleanOptionalfalse
scrapeOptions.timeoutinteger | nullOptional
scrapeOptions.waitForintegerOptional0
sitemapstring Values: skip, include, onlyOptional"include"
webhookstring | object | nullOptional
webhook.urlstringRequired
webhook.eventsstring[] | 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.failedOptional
webhook.headersobject | nullOptional
webhook.metadataobject | nullOptional
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.

FieldWhat DarkCrawl does
integrationAccepted and ignored.
originAccepted and ignored.
promptIgnored, with a warning when set.
robotsUserAgentIgnored, with a warning when set.
scrapeOptions.actionsAnswers 400 NOT_IMPLEMENTED when not empty.
scrapeOptions.auditMetadataAccepted and ignored.
scrapeOptions.blockAdsIgnored, with a warning when not Firecrawl's default.
scrapeOptions.domainToolsAccepted and ignored.
scrapeOptions.fastModeIgnored, with a warning when not Firecrawl's default.
scrapeOptions.integrationAccepted and ignored.
scrapeOptions.locationIgnored, with a warning when not Firecrawl's default.
scrapeOptions.lockdownAnswers 400 BAD_REQUEST when true.
scrapeOptions.maxAgeIgnored, with a warning when not Firecrawl's default.
scrapeOptions.minAgeAnswers 400 BAD_REQUEST when set.
scrapeOptions.mobileIgnored, with a warning when not Firecrawl's default.
scrapeOptions.onlyCleanContentIgnored, with a warning when not Firecrawl's default.
scrapeOptions.originAccepted and ignored.
scrapeOptions.profileIgnored, with a warning when not Firecrawl's default.
scrapeOptions.proxyIgnored, with a warning when not Firecrawl's default.
scrapeOptions.removeBase64ImagesAccepted and ignored.
scrapeOptions.safeModeIgnored, with a warning when not Firecrawl's default.
scrapeOptions.storeInCacheIgnored, with a warning when not Firecrawl's default.
scrapeOptions.threatProtectionAccepted and ignored.
scrapeOptions.toolDetailAccepted and ignored.
scrapeOptions.useMockAccepted and ignored.
scrapeOptions.zeroDataRetentionIgnored, with a warning when not Firecrawl's default.
zeroDataRetentionIgnored, with a warning when set.

Request

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

Status 200.

Response
{
  "success": true,
  "id": "01K0EXAMPLEJOB00000000000A",
  "url": "https://api.darkcrawl.dev/v2/crawl/01K0EXAMPLEJOB00000000000A"
}

Errors

CodeStatus
BAD_REQUEST400
INVALID_ONION400
POLICY_FORBIDDEN400
BLOCKLISTED403
BLOCKLIST_UNAVAILABLE503
SECRETS_UNAVAILABLE503
AI_UNAVAILABLE503
QUOTA_EXCEEDED402
RATE_LIMITED429

What each code means, and what to do about it: Errors.

Notes

  • A limit above the plan's crawl maximum is lowered to it, and a limit above the pages you have left is lowered again. The job's warning says so. With no pages left, nothing starts.
  • Poll url for the job. expiresAt in 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 webhook sends the job's events to your receiver, which must be https. See Webhooks.