PDF to text API Turn any text PDF into clean text with one call
POST a PDF or HTML file to /v1/text and get its text back as JSON: lines in reading order, table cells separated by tabs, and pages separated by a form feed. There is nothing to install, and the same file always gives the same text.
curl https://api.100sands.com/v1/text \
-H "Authorization: Bearer $SANDS_API_KEY" \
-F [email protected]
{
"pages": 3,
"text": "COMPANY EXTRACT\nCompany name\tHarbor Lane Logistics Ltd\nCompany number\t51-482913-6\nStatus\tActive\n..."
}What you get
Lines in reading order
Each line of the page comes back as one line of text, top to bottom, in the order people read it.
Table cells stay apart
Cells on the same line are separated by tabs, so a table pastes straight into a spreadsheet or splits with one line of code.
Every language
Hebrew, Arabic, Persian and Urdu come back in reading order. Hindi, Bengali, Tamil, Thai, Chinese, Japanese and Korean come back as written.
PDF and HTML
The same call reads HTML pages and files. Send the file itself, or a link to it with fileUrl.
Fast and repeatable
Text is read in milliseconds a page, with no AI involved, so the same file always gives the same text.
Clear refusals
A scanned PDF has no text to read, so it is refused with 422 NO_TEXT_IN_FILE and isn't counted.
Your first PDF in three steps
- Create a free account. No credit card.
- In the app, open API keys and create a key. Copy it: it is shown only once.
- Send the PDF as a file field in multipart/form-data, with the key as Authorization: Bearer.
Limits
- Files up to 50 MB
- PDF and HTML files that contain text; scans, photos and images are not read
- Password-protected PDFs are refused with 422 ENCRYPTED_PDF
- In a PDF where only some pages have text, the other pages come back blank
- One document per file, whatever its page count; refused files aren't counted
Price
Free: 100 documents a month. Starter: $20 a month for 20,000. Pro: $79 a month for 100,000. A document is one file, however many pages it has.
Compare the plansQuestions
How do I convert a PDF to text with an API?
Create a free account and an API key, then POST the PDF to /v1/text as multipart/form-data with the key in the Authorization header. The JSON response holds the page count and the document's whole text.
Does it keep tables?
It keeps table cells apart: cells on the same line are separated by tabs, and each row is its own line. To get a table as rows and columns in JSON, set up a document type with a table field.
Can it read scanned PDFs?
No. 100sands reads PDF and HTML files that contain text. A scanned PDF, which holds pictures of text, is refused with 422 NO_TEXT_IN_FILE and isn't counted.
Is the output the same every time?
Yes. The text is read from the file by fixed rules, with no AI involved, so the same file always gives the same text.
Which languages does it read?
Every language. Right-to-left text such as Hebrew and Arabic comes back in reading order, and complex scripts such as Hindi, Thai and Japanese come back as written, with no setting to choose.
Blog
- How to extract text from a PDF in Python
- pypdf vs pdfplumber vs PyMuPDF vs pdfminer.six, on the same files
- How to extract text from a PDF in Node.js
- How to extract text from a PDF in Java with PDFBox
- How to extract text from a PDF in C#
- PDF to text from the command line: pdftotext and curl
- How to get text with its coordinates from a PDF
- Keeping columns and lines in order when extracting PDF text
- Extracting text from Word, Excel, CSV and HTML files
- Why you can't copy text from some PDFs, or get gibberish
- Scanned or searchable? How to tell if a PDF has real text
- Extracting Arabic and other right-to-left text from PDFs
- Password-protected PDFs: why extraction fails and what to do
- How to OCR a scanned PDF in Python
- How to improve OCR accuracy
- How to measure OCR accuracy: character and word error rate
- How to extract tables from a PDF in Python
- Getting clean PDF text for LLMs and RAG
Related
Try it on your own documents
100 documents a month free. No credit card.