L'API PDF conçue pour les développeurs
Un simple endpoint REST par tâche. Fusionnez, convertissez, compressez et protégez des PDFs depuis n'importe quel langage — sans SDK, sans serveurs, sans librairies PDF.
Démarrage rapide
1. Obtenez une clé
Connectez-vous et créez une clé dans votre tableau de bord.
2. Appelez un endpoint
Envoyez votre fichier en multipart/form-data.
3. Récupérez le résultat
Le fichier traité est renvoyé instantanément.
curl -X POST https://smallpdf.us/api/v1/merge \
-H "X-API-Key: YOUR_API_KEY" \
-F "files=@image1.pdf" \
-F "files=@image2.pdf" \
-o merged.pdfAuthentification
Chaque requête doit inclure votre clé secrète dans l'en-tête X-API-Key . Créez et gérez vos clés dans votre tableau de bord. Gardez les clés côté serveur — ne les exposez jamais dans le code client.
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxURL de base & réponses
Tous les endpoints sont POST sous :
- En cas de succès, le fichier traité est retourné directement dans le corps de la réponse.
- En cas d'erreur, un corps JSON est retourné :
{ "error": "...", "code": "..." } - Chaque réponse inclut
X-RateLimit-Limit/X-RateLimit-Remaining - Les fichiers uploadés sont analysés contre les malwares et supprimés de nos serveurs immédiatement après le traitement.
Endpoints
Organiser
/v1/mergeMerge PDFCombine two or more PDFs into a single document, in the order provided.
Paramètres
filesfile[]requisTwo or more PDF files.
Retourne: PDF file · merged.pdf
curl -X POST https://smallpdf.us/api/v1/merge \
-H "X-API-Key: YOUR_API_KEY" \
-F "files=@image1.pdf" \
-F "files=@image2.pdf" \
-o merged.pdf/v1/splitSplit PDFSplit a PDF. Without `pages` you receive a ZIP with one PDF per page; with `pages` you receive a single PDF of just those pages.
Paramètres
filefilerequisThe PDF to split.
pagesstringoptionnelOptional range, e.g. "1,3,5-7".
Retourne: PDF file · split.pdf
curl -X POST https://smallpdf.us/api/v1/split \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-F "pages=1-3" \
-o split.pdf/v1/rotateRotate PDFRotate every page by a multiple of 90 degrees.
Paramètres
filefilerequisThe PDF to rotate.
angleintoptionnel90, 180 or 270. Default 90.
Retourne: PDF file · rotated.pdf
curl -X POST https://smallpdf.us/api/v1/rotate \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-F "angle=90" \
-o rotated.pdfConvertir
/v1/pdf-to-wordPDF to WordConvert a PDF into an editable Word (.docx) document with layout preserved.
Paramètres
filefilerequisThe PDF to convert.
Retourne: Word .docx file · converted.docx
curl -X POST https://smallpdf.us/api/v1/pdf-to-word \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-o converted.docx/v1/word-to-pdfWord to PDFConvert a Word document (.doc, .docx, .odt, .rtf) into a PDF.
Paramètres
filefilerequisThe document to convert.
Retourne: PDF file · converted.pdf
curl -X POST https://smallpdf.us/api/v1/word-to-pdf \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.docx" \
-o converted.pdf/v1/pdf-to-jpgPDF to JPGRender each PDF page to a JPG image. Returns a ZIP archive.
Paramètres
filefilerequisThe PDF to convert.
qualitystringoptionnelstandard (150dpi) · high (300) · maximum (600).
Retourne: ZIP archive of images · pages.zip
curl -X POST https://smallpdf.us/api/v1/pdf-to-jpg \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-F "quality=high" \
-o pages.zip/v1/pdf-to-pngPDF to PNGRender each PDF page to a PNG image. Returns a ZIP archive.
Paramètres
filefilerequisThe PDF to convert.
qualitystringoptionnelstandard · high · maximum.
Retourne: ZIP archive of images · pages.zip
curl -X POST https://smallpdf.us/api/v1/pdf-to-png \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-F "quality=high" \
-o pages.zip/v1/jpg-to-pdfJPG to PDFCombine one or more JPG images into a single PDF (one image per page).
Paramètres
filesfile[]requisOne or more JPG images.
Retourne: PDF file · images.pdf
curl -X POST https://smallpdf.us/api/v1/jpg-to-pdf \
-H "X-API-Key: YOUR_API_KEY" \
-F "files=@image1.jpg" \
-F "files=@image2.jpg" \
-o images.pdf/v1/png-to-pdfPNG to PDFCombine one or more PNG images into a single PDF (one image per page).
Paramètres
filesfile[]requisOne or more PNG images.
Retourne: PDF file · images.pdf
curl -X POST https://smallpdf.us/api/v1/png-to-pdf \
-H "X-API-Key: YOUR_API_KEY" \
-F "files=@image1.png" \
-F "files=@image2.png" \
-o images.pdfOptimiser
/v1/compressCompress PDFReduce a PDF's file size with lossless stream compression.
Paramètres
filefilerequisThe PDF to compress.
Retourne: PDF file · compressed.pdf
curl -X POST https://smallpdf.us/api/v1/compress \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-o compressed.pdfSécuriser
/v1/protectProtect PDFEncrypt a PDF with AES-256 so it can only be opened with the password.
Paramètres
filefilerequisThe PDF to protect.
passwordstringrequisPassword required to open the file.
Retourne: PDF file · protected.pdf
curl -X POST https://smallpdf.us/api/v1/protect \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@input.pdf" \
-F "password=secret123" \
-o protected.pdfPlans & quota
| Plan | Appels API | Prix |
|---|---|---|
| Free | 50 / month | $0 |
| Starter | 1,000 / month | $9/mo |
| Pro | 10,000 / month | $19/mo |
| Max | 100,000 / month | Contact sales |
Le quota est réinitialisé le 1er de chaque mois (UTC). Seuls les appels réussis sont comptabilisés. Voir les tarifs complets →
Codes de statut & d'erreur
| HTTP | Code | Signification |
|---|---|---|
| 200 | — | Success. The processed file is returned in the body. |
| 400 | BAD_INPUT | Missing or invalid file / parameters. |
| 401 | NO_API_KEY · BAD_API_KEY | Missing, invalid or revoked key. |
| 429 | QUOTA_EXCEEDED | Monthly quota used up — upgrade your plan. |
| 500 | PROCESSING_ERROR | The file could not be processed. |
Commencez à développer aujourd'hui
Créez une clé API gratuite et effectuez votre premier appel en moins d'une minute.
Obtenir votre clé API