Documents & media
Documents & media · AI-assisted
PDF to Text API
PDF to text page by page with metadata; AI OCR for scanned pages and clean Markdown with tables.
Base URLhttps://pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com/v1/pdfopenapi.json
- Free plan
- 20 credits a day
- Paid plans
- from $4.99 a month
- One credit
- 1 credit per 20 text pages, 20 per page read by the AI.
- Endpoints
- 2, on
/v1/pdf
Example call
curl -X POST "https://pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com/v1/pdf/extract" \
-H "X-RapidAPI-Key: YOUR_API_KEY" \
-H "X-RapidAPI-Host: pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{
"url": "https://arxiv.org/pdf/1706.03762",
"mode": "ai",
"pages": "1-3"
}'
import requests
url = "https://pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com/v1/pdf/extract"
payload = {
"url": "https://arxiv.org/pdf/1706.03762",
"mode": "ai",
"pages": "1-3"
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com",
}
r = requests.post(url, json=payload, headers=headers)
print(r.json())
const res = await fetch("https://pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com/v1/pdf/extract", {
method: "POST",
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://arxiv.org/pdf/1706.03762",
"mode": "ai",
"pages": "1-3"
}),
});
console.log(await res.json());
{
"source": "https://arxiv.org/pdf/1706.03762",
"page_count": 15,
"pages_extracted": 3,
"text_pages": 0,
"ai_pages": 3,
"metadata": {
"creator": "LaTeX with hyperref",
"producer": "pdfTeX-1.40.25",
"created": "2024-04-10T21:11:43+00:00"
},
"text": "Attention Is All You Need\nAshish Vaswani ...",
"markdown": "Attention Is All You Need\n...\n## Abstract\n\nThe dominant sequence transduction models ...\n\n---\n\n...",
"pages": [
{ "page": 1, "method": "ai", "text": "Attention Is All You Need ...", "markdown": "Attention Is All You Need ..." },
{ "page": 3, "method": "ai", "text": "...", "markdown": "...\n[Figure: Output Probabilities, Softmax, Linear, Add & Norm, ...]\n..." }
]
}
Extract PDF from URL: POST /v1/pdf/extract. A real call and its real response, with long values shortened.
What the PDF to Text API returns
Reports, contracts, papers, invoices, brochures, scanned archives: send a PDF link or upload the PDF, get back its text page by page with the document metadata. Scanned pages are read by AI OCR automatically, and AI mode returns Markdown with headings and tables, ready for RAG and LLM pipelines.
- Smart by default
- The PDF's own text layer when it exists (fast, exact, cheap), AI only for scanned pages
- Scanned PDFs
- Image-only pages read by AI, handwriting included
- Markdown with tables
- AI mode rebuilds headings, lists and tables; figures become one
[Figure: ...]line - Page by page
- Every page with its number and how it was read (
textorai) - Metadata
- Title, author, subject, creator, producer, creation and modification dates
- Page ranges and passwords
"pages": "1-5,8","password": "..."
Endpoints
Host pdf-to-text-markdown-tables-scanned-pdf-ocr.p.rapidapi.com, header X-RapidAPI-Key. Parameters and examples for each one are in the API reference.
PDF Extraction
PDF to text and Markdown, page by page.
Use cases
- RAG & search. Feed clean, page-numbered text and Markdown to your vector database
- Document automation. Contracts, reports and invoices into your workflows
- Archives. Make scanned documents searchable
- Research. Extract papers with their tables and section structure
Tutorial
Documents & media
Pricing
1 credit per 20 text pages, 20 per page read by the AI. Failed calls are never billed.
| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 20 / day | resets every day |
| PRO | $4.99/mo | 16,000 / month | $0.0035 per credit |
| ULTRA | $14.99/mo | 48,000 / month | $0.0035 per credit |
| MEGA | $49.99/mo | 160,000 / month | $0.0035 per credit |
Subscribe on RapidAPI (opens in a new tab)
No code: the Apify actor
The PDF to Text Extractor - Scanned PDF OCR actor runs the same engine on a list of inputs and exports a table (JSON, CSV, Excel, Google Sheets). It is billed per result; free-plan users get 5 PDFs of 10 pages per run.
| Event | Charged for | Price |
|---|---|---|
text-page | Each text-layer page | $0.0002 |
ai-page | Each page read by the AI | $0.0045 |
Questions about the PDF to Text API
Which mode?
auto for almost everything, text for the lowest price on digital PDFs, ai when the layout matters (tables, multi-column papers, forms).Why is text-layer output sometimes oddly spaced?
ai mode for clean reading order.





