Skip to main content
Live

PDFs and documents

Parse turns a PDF or DOCX, uploaded or linked by URL, into markdown or chunks for 1 credit per PDF page parsed, or 1 per DOCX. A 300-page PDF costs 300 credits; set maxPages to cap it, and the Free plan includes 1,000 credits a month.

Endpoints

  • POST/v1/parseA PDF or DOCX, uploaded as a file or linked by URL, as markdown, text or chunks.

Try it

TryA PDF or DOCX link to markdown. Scanned PDFs with no text layer are not read yet.

Example outputhttps://www.irs.gov/pub/irs-pdf/fw9.pdf

status ok · 6 of 6 pages parsed
## Page 1
Form W-9 (Rev. March 2024) Request for Taxpayer
Identification Number and Certification
Department of the Treasury Internal Revenue Service
Go to www.irs.gov/FormW9 for instructions and the
latest information.
Fetched by
document URL
Read by
pdfjs
Cost
6 credits (1 per page)

Example values. No completeness count for this result.

Shows example output until you press Run. Demo runs are free, up to 10 every 5 minutes.

What it returns

POST /v1/parse

Response fields for POST /v1/parse
statusok, partial or failed.Always
parserWhich parser read the file: pdfjs, docx or none.Always
markdown, textThe document as markdown and as plain text.On ok and partial
pages_total, pages_parsedHow many pages the document has and how many were read.Always (null for DOCX)
truncatedTrue when the parser stopped early, with truncated_reason.Always
pages_without_textPages with no text layer, with partial_reason.When some pages have no text
chunks[]Each chunk has text, heading, headingPath, headingLevel, charStart, charEnd and position. totalChunks counts them.When format is rag
source, cachedupload or url, and whether the result came from cache.Always
credits_chargedCredits this call cost: 1 per PDF page parsed, 1 for a DOCX, 0 when nothing was extracted.Always

Parse responses carry no completeness score. status and the page counts say what was read.

Limits today

  • No OCR today. A scanned or image-only PDF fails with 422 no_text_layer.
  • A PDF with more than 50 pages to parse, or a request with async: true, runs as a background job: the call answers 202 with a jobId, you poll GET /v1/jobs/:id for the result, and an optional webhook is called when the job ends. A job reads up to 2,000 pages, at the same 1 credit per parsed page. With async: false the limit is 300 pages per document; more returns 413 page_limit before any page is parsed.
  • Up to 25 MB per document by default. A larger upload returns 413 file_too_large; a larger download from a URL returns 413 download_too_large.
  • PDF and DOCX only.

One request

Send your key as a Bearer token. Every parameter in these samples is one the endpoint reads today. The Example tab shows a trimmed response for a fictional business.

Every parameter in the docs
curl -X POST https://api.superscraper.dev/v1/parse \
  -H "Authorization: Bearer $SUPERSCRAPER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
    "format": "rag",
    "chunkSize": 1000
  }'

# Or upload a file (multipart)
curl -X POST https://api.superscraper.dev/v1/parse \
  -H "Authorization: Bearer $SUPERSCRAPER_API_KEY" \
  -F "file=@report.pdf" \
  -F "format=markdown"
Parse
1credit per PDF page parsed
  • A PDF costs 1 credit for each page whose text is extracted, whatever the output format. Pages with no text layer are free.
  • maxPages parses only the first pages of a PDF and caps the credits. A DOCX costs 1 credit, whatever its length.
  • A parse that extracts nothing costs 0.

Questions

How much does a PDF cost?

1 credit for each page whose text is extracted, so a 300-page PDF costs 300 credits. Set maxPages to read only the first pages and cap the cost. The credits are held before the first page is read: on the Free plan, a balance that cannot cover them returns 402 and nothing is parsed.

Can it read scanned PDFs?

Not today. A document with no text layer fails with 422 no_text_layer. In a mixed document, pages without text are listed in pages_without_text and the status is partial.

How are chunks split?

On headings first, then on paragraphs, sentences and spaces when a section runs past chunkSize. The default is 1,000 characters with 100 characters of overlap, and chunkSize accepts 100 to 20,000.

Can I upload a file instead of a URL?

Yes. Send multipart/form-data with the file in the file field. format, chunkSize, chunkOverlap and maxPages work as form fields too.

What does a truncated result mean?

The parser stopped before the end, for example on a time or text budget. truncated_reason says which, and pages_parsed says how far it got.