Your documents. Ready for your agent.
Turn PDFs, office documents, and spreadsheets into readable Markdown, in the same workflows that use your web data.
Document input
report.pdf
12 pages · 2.4 MB
Markdown output
report.md
# Product research
Findings from customer interviews
and public documentation.
## What we learned
- Keep context with its source
- Refresh content when it changes
- Cite the page an answer came fromDocuments, spreadsheets, scans. One readable format.
Send the file bytes you already have and get Markdown back, with OCR for scanned pages and control over what comes through.
Bring your own files
Send file bytes directly. Parse supports documents, spreadsheets, presentations, text, code, and supported image formats.
- DOCX
- XLSX
- PPTX
- CSV
- HTML
- MD
- PY
- PNG
Read scanned PDFs
Enable OCR to recover selected PDF pages without a usable text layer. Pages that already contain text keep it.
ocrtrue- Page 1Text layerKept
- Page 2ScannedOCR
- Page 3ScannedOCR
Control the output
Choose a PDF page range, preserve links, and include image references when your workflow needs them.
pdf.start1pdf.end4includeLinkstrueincludeImagestrue
A file goes in. Markdown comes out.
Send a file stream with an optional extension hint. Read the Markdown and detected file type from the response, then combine it with your web content.
npm install context.devimport { createReadStream } from 'node:fs';
import ContextDev from 'context.dev';
const client = new ContextDev({ apiKey: 'YOUR_API_KEY' });
const document = await client.parse.handle(
createReadStream('report.pdf'),
{ extension: 'pdf', ocr: true },
);
console.log(document.markdown);
console.log(document.type);From your first request to a working feature.
Send the file
Upload the file bytes with the SDK or a POST request. Add an extension hint when needed.
Choose what to read
Limit PDF pages or enable OCR for scans. Keep the links and image references your application needs.
Use the content
Chunk and index the Markdown for retrieval, or give it directly to an agent as document context.
A few things to know.
More details in the API documentation.
How is Parse different from Scrape?
Parse accepts file bytes you already have. Scrape starts from a URL and can return page content, images, screenshots, bytes, and fields selected with CSS rules.
Is this the same as the parse format in Scrape?
They serve different inputs. Scrape’s parse format selects fields from a web page with CSS rules. The Parse File API converts uploaded files into Markdown.
Can I parse a scanned PDF?
Yes. Set ocr to true to recover PDF pages without a usable text layer. You can restrict the operation with pdf.start and pdf.end. OCR has an additional charge for each page actually recovered.
Can I parse a document at a public URL?
Use Scrape for a document URL. Use Parse when you already have the file and want to send its bytes directly, including files uploaded by your users.
Start with your next request.
One API key for scraping, research, brand data, batches, and monitoring.



