API PDF yang dibuat untuk developer
Satu endpoint REST sederhana per tugas. Gabung, konversi, kompres, dan lindungi PDF dari bahasa apa pun — tanpa SDK, tanpa server, tanpa library PDF.
Mulai cepat
1. Dapatkan key
Masuk dan buat key di dashboard Anda.
2. Panggil endpoint
POST file Anda sebagai multipart/form-data.
3. Dapatkan hasilnya
File yang diproses langsung dikembalikan.
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.pdfAutentikasi
Setiap permintaan harus menyertakan kunci rahasia Anda di header X-API-Key . Buat dan kelola kunci di dashboard. Simpan kunci di sisi server — jangan pernah ekspos di kode klien.
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxURL dasar & respons
Semua endpoint adalah POST di bawah:
- Jika berhasil, file yang diproses dikembalikan langsung di body.
- Jika error, body JSON dikembalikan:
{ "error": "...", "code": "..." } - Setiap respons menyertakan
X-RateLimit-Limit/X-RateLimit-Remaining - Upload dipindai malware dan dihapus dari server kami segera setelah diproses.
Endpoint
Atur
/v1/mergeMerge PDFCombine two or more PDFs into a single document, in the order provided.
Parameter
filesfile[]wajibTwo or more PDF files.
Mengembalikan: 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.
Parameter
filefilewajibThe PDF to split.
pagesstringopsionalOptional range, e.g. "1,3,5-7".
Mengembalikan: 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.
Parameter
filefilewajibThe PDF to rotate.
angleintopsional90, 180 or 270. Default 90.
Mengembalikan: 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.pdfKonversi
/v1/pdf-to-wordPDF to WordConvert a PDF into an editable Word (.docx) document with layout preserved.
Parameter
filefilewajibThe PDF to convert.
Mengembalikan: 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.
Parameter
filefilewajibThe document to convert.
Mengembalikan: 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.
Parameter
filefilewajibThe PDF to convert.
qualitystringopsionalstandard (150dpi) · high (300) · maximum (600).
Mengembalikan: 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.
Parameter
filefilewajibThe PDF to convert.
qualitystringopsionalstandard · high · maximum.
Mengembalikan: 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).
Parameter
filesfile[]wajibOne or more JPG images.
Mengembalikan: 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).
Parameter
filesfile[]wajibOne or more PNG images.
Mengembalikan: 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.pdfOptimalkan
/v1/compressCompress PDFReduce a PDF's file size with lossless stream compression.
Parameter
filefilewajibThe PDF to compress.
Mengembalikan: 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.pdfAmankan
/v1/protectProtect PDFEncrypt a PDF with AES-256 so it can only be opened with the password.
Parameter
filefilewajibThe PDF to protect.
passwordstringwajibPassword required to open the file.
Mengembalikan: 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.pdfPaket & kuota
| Paket | Panggilan API | Harga |
|---|---|---|
| Free | 50 / month | $0 |
| Starter | 1,000 / month | $9/mo |
| Pro | 10,000 / month | $19/mo |
| Max | 100,000 / month | Contact sales |
Kuota direset pada tanggal 1 setiap bulan (UTC). Hanya panggilan berhasil yang dihitung. Lihat harga lengkap →
Kode status & error
| HTTP | Kode | Arti |
|---|---|---|
| 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. |
Mulai membangun hari ini
Buat API key gratis dan buat panggilan pertama dalam kurang dari satu menit.
Dapatkan API key Anda