Extraer texto de un PDF
Extraer texto es una API que saca todo el texto de un PDF, listo para buscar, analizar o guardar en una hoja de cálculo. Perfecto para procesar facturas, contratos o informes desde n8n, Make o Zapier, sin montar servidores.
Cómo funciona
Le mandas un PDF y te devuelve su texto en un JSON, junto con el número de páginas y los metadatos del documento (título, autor…). No guarda nada: se procesa al momento.
Ojo con los PDFs escaneados: si el PDF es una foto o un escaneo sin capa de texto (no puedes seleccionar el texto al abrirlo en tu ordenador), esta herramienta devuelve texto vacío — no da error, simplemente no hay texto que extraer. Para esos casos hace falta OCR, que esta herramienta no hace.
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
Cómo usarlo en n8n (paso a paso)
Le envías tu PDF tal cual (como archivo binario) y te devuelve el texto en JSON. En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/pdf-extract-text - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type=application/pdf - Send Body: actívalo → elige la opción para mandar un archivo binario (en n8n: "n8n Binary File", con la propiedad binaria de tu PDF, normalmente
data)
La respuesta ya es un JSON con el texto en text: puedes usarlo directamente en el siguiente paso (buscar una palabra, guardarlo en una hoja de cálculo, mandarlo a un modelo de IA…).
En Make (módulo HTTP → Make a request): mismo método y URL, en Headers las dos cabeceras, y el PDF como dato binario en el cuerpo.
Opciones (en Query Parameters o en el JSON)
| Opción | Por defecto | Para qué sirve |
|---|---|---|
pages | false | Ponlo en true para recibir además el texto separado por página. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/pdf-extract-text - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: el PDF va en el cuerpo como
application/pdf(a pelo) o comoapplication/jsoncon{ "file": "<base64>", "pages": true }. - Salida: SIEMPRE JSON (el resultado es texto, no un PDF):
{ text, num_pages, info, pages? }. - PDF sin capa de texto (escaneado):
text: "", sigue siendosuccess: truey consume 1 crédito — no es un error. - Límites: PDF de entrada hasta 20 MB (50 MB en Business/Scale) en modo
application/pdf, o ~4 MB reales en JSON con base64. 30 peticiones/min por IP. 1 extracción = 1 crédito.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
pages | false | true añade pages: un array con el texto de cada página por separado. |
file | — | Solo en modo JSON: el PDF en base64. |
Ejemplos
curl (PDF a pelo):
curl -X POST "https://api.cofferdock.com/pdf-extract-text?pages=true" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/pdf" \
--data-binary @documento.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': 'TU_LLAVE', 'Content-Type': 'application/pdf' },
body: fs.readFileSync('documento.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': 'TU_LLAVE', 'Content-Type': 'application/pdf'},
data=open('documento.pdf', 'rb').read(),
)
print(r.json()['text'])
Forma de la respuesta
{ "success": true,
"text": "Factura 001\nTotal: 100 €\n…",
"num_pages": 2,
"info": { "Title": "Factura 001", "Producer": "Cofferdock" },
"meta": { "size_bytes": 51204, "used": 12, "remaining": 488 } }
Con pages=true se añade además "pages": ["texto de la página 1", "texto de la página 2"].
Lo que recibes
Un JSON con el texto completo del PDF, el número de páginas y sus metadatos (título, autor…).
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…).