Parse
POST /v2/parse
Copy page
Upload a PDF, an Office file or an image and get its text back. An image is read by OCR, only with the image parser on.
POST /
Authentication: your key as a bearer token.
Body
| Field | Type | Required | Default |
|---|---|---|---|
file | file | Required | |
options | object | Optional | |
options. | (string | object)[] | Optional | ["markdown"] |
options. | integer | null | Optional | 30000 |
options. | (string | object)[] | Optional | |
options. | boolean | object | 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 |
|---|---|
options.onlyMainContent | Ignored, with a warning when not Firecrawl's default. |
options.includeTags | Ignored, with a warning when not Firecrawl's default. |
options.excludeTags | Ignored, with a warning when not Firecrawl's default. |
options.mobile | Ignored, with a warning when not Firecrawl's default. |
options.blockAds | Ignored, with a warning when not Firecrawl's default. |
options.fastMode | Ignored, with a warning when not Firecrawl's default. |
options.origin | Accepted and ignored. |
options.skipTlsVerification | Accepted and ignored. |
options.removeBase64Images | Accepted and ignored. |
Request
curl -X POST https://api.darkcrawl.dev/v2/parse \
-H "Authorization: Bearer $DARKCRAWL_API_KEY" \
-F "file=@<your file>" \
-F 'options={"formats":["markdown","links"]}'Response
Status 200.
{
"success": true,
"data": {
"markdown": "# Sample report\n\nPage one of a fictional PDF.\n",
"indicators": [],
"metadata": {
"title": "Sample report",
"numPages": 1,
"totalPages": 1,
"sourceFile": "report.pdf",
"contentType": "application/pdf",
"document": {
"type": "pdf",
"pages": 1,
"totalPages": 1,
"ocrPages": 0,
"truncated": false,
"encrypted": false
}
}
}
}Errors
| Code | Status |
|---|---|
BAD_REQUEST | 400 |
NOT_IMPLEMENTED | 400 |
POLICY_FORBIDDEN | 400 |
SCRAPE_TIMEOUT | 408 |
PAYLOAD_TOO_LARGE | 413 |
EXTRACTION_FAILED | 422 |
AI_UNAVAILABLE | 503 |
BLOCKLIST_UNAVAILABLE | 503 |
EXTRACTION_UNAVAILABLE | 503 |
What each code means, and what to do about it: Errors.
Notes
- The request is
multipart/form-data: afilepart and, optionally, anoptionspart that holds JSON. - Any other
optionsfield answers400 BAD_REQUEST. What is read, and the limits, are on Parse.