Extract text from a PDF
Extract text is an API that pulls all the text out of a PDF, ready to search, analyze or store in a spreadsheet. Great for processing invoices, contracts or reports from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a PDF and get back its text in a JSON object, along with the page count and the document's metadata (title, author…). Nothing is stored: it's processed on the fly.
A note on scanned PDFs: if the PDF is a photo or scan with no text layer (you can't select the text when you open it on your computer), this tool returns empty text: it's not an error, there's simply no text to extract. That case needs OCR, which this tool doesn't do.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
How to use it in n8n (step by step)
You send your PDF as is (as binary data) and get the text back in JSON. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-extract-text - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/pdf - Send Body: on → choose the binary file option (in n8n: "n8n Binary File", with your PDF's binary property, usually
data)
The response is already a JSON with the text in text: use it directly in the next step (search for a word, save it to a spreadsheet, send it to an AI model…).
In Make (HTTP → Make a request module): same method and URL, the two headers in Headers, and the PDF as binary data in the body.
Options (as Query Parameters or in the JSON)
| Option | Default | What it does |
|---|---|---|
pages | false | Set to true to also get the text split by page. |
API overview
- Endpoint:
POST https://api.cofferdock.com/pdf-extract-text - Auth: header
x-api-key: YOUR_KEY. - Input: the PDF goes in the body as
application/pdf(raw) or asapplication/jsonwith{ "file": "<base64>", "pages": true }. - Output: ALWAYS JSON (the result is text, not a PDF):
{ text, num_pages, info, pages? }. - PDF with no text layer (scanned):
text: "", stillsuccess: trueand still costs 1 credit: not an error. - Limits: input PDF up to 20 MB (50 MB on Business/Scale) in
application/pdfmode, or ~4 MB real in JSON with base64. 30 requests/min per IP. 1 extraction = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
pages | false | true adds pages: an array with each page's text separately. |
file | - | JSON mode only: the PDF in base64. |
Examples
curl (raw PDF):
curl -X POST "https://api.cofferdock.com/pdf-extract-text?pages=true" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf
JavaScript (Node 18+):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/pdf-extract-text', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('document.pdf'),
});
const j = await r.json();
console.log(j.text);
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/pdf-extract-text',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/pdf'},
data=open('document.pdf', 'rb').read(),
)
print(r.json()['text'])
Response shape
{ "success": true,
"text": "Invoice 001\nTotal: 100 €\n…",
"num_pages": 2,
"info": { "Title": "Invoice 001", "Producer": "Cofferdock" },
"meta": { "size_bytes": 51204, "used": 12, "remaining": 488 } }
With pages=true the response also includes "pages": ["page 1 text", "page 2 text"].
What you get back
A JSON object with the PDF's full text, its page count and its metadata (title, author…).