1. Get a key
The API is included in the Pro plan. Create a key in Dashboard › API keys. Keep it secret: it is shown only once.
2. Send a file
POST request as multipart/form-data, key in the Authorization header. The response is the resulting file.
curl -X POST https://typelia.com/v1/compress \ -H "Authorization: Bearer pdfa_VOTRE_CLE" \ -F "file=@contrat.pdf" -F "level=high" \ -o contrat-compresse.pdf
# Python
import requests
r = requests.post("https://typelia.com/v1/merge",
headers={"Authorization": "Bearer pdfa_VOTRE_CLE"},
files=[("file", open("a.pdf", "rb")), ("file", open("b.pdf", "rb"))])
r.raise_for_status()
open("fusion.pdf", "wb").write(r.content)// JavaScript (Node 18+)
const form = new FormData();
form.append("file", new Blob([await fs.promises.readFile("scan.pdf")]), "scan.pdf");
const res = await fetch("https://typelia.com/v1/ocr", { method: "POST", headers: { Authorization: "Bearer pdfa_VOTRE_CLE" }, body: form });
await fs.promises.writeFile("scan-ocr.pdf", Buffer.from(await res.arrayBuffer()));3. Tools
| Endpoint | File | Options | Does |
|---|---|---|---|
/v1/compress | level=low|medium|high | Compresser | |
/v1/merge | PDF ×2+ | — | Fusionner (répéter le champ file) |
/v1/ocr | force=true | Reconnaître le texte des scans | |
/v1/pdf-to-word | — | PDF → .docx | |
/v1/pdf-to-text | — | PDF → .txt | |
/v1/pdf-to-images | format=png|jpg, dpi=150 | Pages en images (ZIP) | |
/v1/protect | password=… | Mot de passe (AES-256) | |
/v1/watermark | text, position, angle, opacity, color | Filigrane | |
/v1/page-numbers | format={n}, position, start, size | Numéros de page | |
/v1/anonymize | kinds=email,phone,iban,card,nir,address,postcode,date,siret ; words | Effacer les données personnelles | |
/v1/office-to-pdf | Word / Excel / PowerPoint | — | Office → PDF |
/v1/images-to-pdf | Images ×1+ | — | Images → PDF |
/v1/html-to-pdf | — | url=https://… | Page web → PDF |
Errors and limits
- Error: JSON { "error": "…" } with status 400, 401 (missing or revoked key), 402 (Pro plan required), 404 (unknown tool) or 429 (monthly quota reached).
- Headers X-Usage-Month and X-Usage-Limit show your usage this month.
- Files up to 500 MB. Documents are deleted from the server after processing.
- Need more calls? Contact us.