Extract Text from PDF

PythonTools
POST api.upapi.io/pdf-extract-text.post

Extract 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.

pdftextextractdocumentparsetables
AuthAPI key
Cost2 units
Timeout25s
Cache86400s

Request schema

FieldTypeDescription
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
booleanAlso detect tables and return each one as a Markdown table (e.g. false). Slower — leave off unless you need them.· default: false

Response schema

FieldTypeDescription
textreq
stringAll extracted text, pages joined by a blank line
pagesreq
integerNumber of pages the document contains
tables
Detected tables; null unless tables was true· default: null
pageTextsreq
arrayText of each extracted page, in order
truncatedreq
booleanTrue when output was cut at the 600000-character response cap
extractedPagesreq
array1-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.

Drop a file here, or click to browseapplication/pdf · up to 3.7 MB

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.

Sign in

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 }'

Developer tools

OpenAPI specImport the spec or collection into Postman, Insomnia, or any codegen tool.