Extract Text from PDF
PythonToolsPOST api.upapi.io/pdf-extract-text.postExtract the text of a PDF, by URL or as an inline base64 upload. Optionally restrict it to a page range and detect tables, returned as Markdown. Runs locally on PDFium — no third-party document API, no per-page fee.
Request schema
| Field | Type | Description |
|---|---|---|
url | Public URL of the PDF to read (e.g. https://example.com/report.pdf). Provide this OR file, not both.· default: null | |
file | The PDF itself, base64-encoded (no data: URI prefix). Max 3.7 MB decoded — base64 inflates by 4/3 and the API request body is capped at 5 MB. Supply url instead for anything larger. Expected media type application/pdf.· default: null | |
pages | Page range to extract, 1-based and inclusive (e.g. 1-5,8,11-13). Omit for the whole document.· default: null | |
tables | boolean | Also detect tables and return each one as a Markdown table (e.g. false). Slower — leave off unless you need them.· default: false |
Response schema
| Field | Type | Description |
|---|---|---|
textreq | string | All extracted text, pages joined by a blank line |
pagesreq | integer | Number of pages the document contains |
tables | Detected tables; null unless tables was true· default: null | |
pageTextsreq | array | Text of each extracted page, in order |
truncatedreq | boolean | True when output was cut at the 600000-character response cap |
extractedPagesreq | array | 1-based page numbers actually extracted |
Try it
Try it
Public URL of the PDF to read (e.g. https://example.com/report.pdf). Provide this OR file, not both.
The PDF itself, base64-encoded (no data: URI prefix). Max 3.7 MB decoded — base64 inflates by 4/3 and the API request body is capped at 5 MB. Supply url instead for anything larger. Expected media type application/pdf.
Sent inline as base64, so the request body cap applies — files up to 3.7 MB.
Page range to extract, 1-based and inclusive (e.g. 1-5,8,11-13). Omit for the whole document.
Also detect tables and return each one as a Markdown table (e.g. false). Slower — leave off unless you need them.
Run this endpoint live
Jump in as a guest — no signup — and run pdf-extract-text.post with your own inputs. Create a free account anytime to get your own API key.
Code examples
curl -X POST https://api.upapi.io/pdf-extract-text.post \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{ "url": "https://example.com/report.pdf", "tables": false }'