PDF to Text and Markdown API
Public PDF URL in. Text and Markdown out.
HTTP on RapidAPI. Bulk on Apify.
About
Point the API at one or two public PDF URLs and it returns the extracted text layer as plain text and as Markdown (headings and lists are inferred from font sizes). Each result includes metadata such as title, author, dates, page counts, character and word counts, a SHA-256 of the file, and a needsOcr flag when the file is an image-only scan. Private or local addresses are blocked. There is no OCR: scanned PDFs are detected, marked, and — on Apify — returned free of charge so you can send them to a dedicated OCR tool.
What you get
- Text and Markdown from the PDF text layer
- Page count, character count, and whether the sample text is truncated
Use
- Turn public filings, papers, and reports into text or Markdown ready for a vector store.
- Chunk by page: request include_pages and cite page-level text in an agent answer.
- Skip scanned or empty files automatically — they come back as no_text_layer with needsOcr=true, unbilled on Apify.
Limits
- 2 public PDF URLs per call
- 15 MB and 50 pages per file
- 25 second timeout
Try it without a key
No key. 5 calls per address per day, and $0.50 for everyone per UTC day. One row per call. A key is on RapidAPI and Apify.
curl -X POST "https://api.impakt.dev/pdf/extract" -H "content-type: application/json" -d '{"urls":["https://arxiv.org/pdf/1706.03762"],"max_pages":1}'
Endpoints
POST
/pdf/extract
Extract text and Markdown from PDF URLs
Up to 2 public PDF URLs per marketplace call (files up to 15 MB, up to 50 pages each). Private or local addresses are blocked.
Inputs
-
urlsstring[] body requiredDirect public HTTP or HTTPS links to PDF files.
-
formatstring body default bothtext, markdown, or both.
-
max_pagesinteger body default 30Only the first N pages are extracted (the result is marked truncated if more pages exist).
-
include_pagesboolean body default falseAdd a pages array with the text of each page, useful for citations and chunking.
Returns
-
status / errorstringok, no_text_layer, download_failed, or similar, with an error message when not ok.
-
urlstringThe public PDF URL that was extracted.
-
text / markdownstringExtracted plain text and Markdown, depending on the requested format.
-
title / author / creator / producer / pdfVersionstringPDF metadata when the file provides it, including the creator, producer, and PDF version. subject, createdAt, and modifiedAt are included when present.
-
pageCount / pagesExtracted / truncatedinteger / booleanHow many pages the file has, how many were extracted, and whether the cap cut the file short. Per-page text is returned only when include_pages is true.
-
charCount / wordCount / needsOcrinteger / booleanSize of the extracted text, and whether the PDF appears to be a scan with no text layer. A SHA-256, file size, and processing time are included on each result.
POST https://pdf-to-text-markdown-api.p.rapidapi.com/pdf/extract
X-RapidAPI-Key: YOUR_RAPIDAPI_KEY
X-RapidAPI-Host: pdf-to-text-markdown-api.p.rapidapi.com
Content-Type: application/json
{
"urls": [
"https://arxiv.org/pdf/1706.03762"
],
"format": "both",
"max_pages": 1,
"include_pages": false
}
{
"count": 1,
"limit": 1,
"results": [
{
"url": "https://arxiv.org/pdf/1706.03762",
"status": "ok",
"error": null,
"title": null,
"author": null,
"creator": "LaTeX with hyperref",
"producer": "pdfTeX-1.40.25",
"pdfVersion": "1.5",
"pageCount": 15,
"pagesExtracted": 1,
"truncated": true,
"charCount": 173,
"wordCount": 26,
"needsOcr": false,
"text": "Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or scholarly works.",
"markdown": "Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or scholarly works."
}
],
"request_id": "00000000-0000-4000-8000-000000000000"
}
Pricing
| Marketplace | Price | Link |
|---|---|---|
| RapidAPI | BASIC $0/month (5 requests, hard cap, no overage). PRO $9.99/month for 600 requests. ULTRA $29.99/month for 2,000 requests. MEGA $79.99/month for 6,000 requests. Overage $0.015 per request. | RapidAPI Opens in a new tab. |
| Apify | PDF to text and Markdown: $3 per 1,000 PDFs. A $0.0001 start fee applies. Failed downloads and image-only PDFs are not billed. | Apify Opens in a new tab. |
FAQ
Does this API perform OCR?
No. It extracts the embedded text layer. Scanned PDFs come back with status no_text_layer and needsOcr=true, and they are not billed on Apify. Use a separate OCR tool for those files.
Can it read Google Drive, Dropbox, or S3 files?
Yes, if you pass a direct public download link (for Drive, a uc?export=download link). Private links that need a login cannot be fetched.
How good is the Markdown?
Headings and lists are inferred from font sizes, so unusual layouts can differ from the original. Tables are returned as text, not as Markdown tables. Multi-column pages are read in vertical order and may interleave columns.
What about password-protected or very large PDFs?
Password-protected files are not opened. Files over the size cap are skipped. Only the first max_pages pages are extracted, and the result is marked truncated when more pages remain.
Who is responsible for copyright and privacy?
You are. The API only downloads the URLs you provide. You must have the right to process those documents and must follow copyright, privacy, and data-protection laws that apply to them.