Typelia

API

PDF API for developers

The same tools as on the website, from your code: one request, one file back.

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

EndpointFileOptionsDoes
/v1/compressPDFlevel=low|medium|highCompresser
/v1/mergePDF ×2+—Fusionner (répéter le champ file)
/v1/ocrPDFforce=trueReconnaître le texte des scans
/v1/pdf-to-wordPDF—PDF → .docx
/v1/pdf-to-textPDF—PDF → .txt
/v1/pdf-to-imagesPDFformat=png|jpg, dpi=150Pages en images (ZIP)
/v1/protectPDFpassword=…Mot de passe (AES-256)
/v1/watermarkPDFtext, position, angle, opacity, colorFiligrane
/v1/page-numbersPDFformat={n}, position, start, sizeNuméros de page
/v1/anonymizePDFkinds=email,phone,iban,card,nir,address,postcode,date,siret ; wordsEffacer les données personnelles
/v1/office-to-pdfWord / Excel / PowerPoint—Office → PDF
/v1/images-to-pdfImages ×1+—Images → PDF
/v1/html-to-pdf—url=https://…Page web → PDF

Errors and limits