API do PDF stworzone z myślą o programistach
Jeden prosty endpoint REST na każde zadanie. Łącz, konwertuj, kompresuj i zabezpieczaj pliki PDF z dowolnego języka. Bez SDK, bez własnych serwerów, bez walki z bibliotekami PDF.
Szybki start
1. Weź klucz
Zaloguj się i utwórz klucz w swoim panelu.
2. Wywołaj endpoint
Wyślij plik metodą POST jako multipart/form-data.
3. Odbierz wynik
Przetworzony plik wraca od razu w odpowiedzi.
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.pdfUwierzytelnianie
Każde żądanie musi zawierać Twój tajny klucz w nagłówku X-API-Key przy każdym wywołaniu. Klucze tworzysz i zarządzasz nimi w swoim panelu. Trzymaj klucze po stronie serwera i nigdy nie umieszczaj ich w kodzie klienta.
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxAdres bazowy i odpowiedzi
Wszystkie endpointy działają metodą POST pod adresem:
- Gdy wszystko się uda, przetworzony plik wraca bezpośrednio w treści odpowiedzi.
- W razie błędu dostajesz treść w formacie JSON:
{ "error": "...", "code": "..." } - Każda odpowiedź zawiera
X-RateLimit-Limit/X-RateLimit-Remaining - Wgrane pliki są skanowane pod kątem złośliwego oprogramowania i usuwane z naszych serwerów zaraz po przetworzeniu.
Endpointy
Organizacja
/v1/mergeMerge PDFCombine two or more PDFs into a single document, in the order provided.
Parametry
filesfile[]wymaganyTwo or more PDF files.
Zwraca: 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.
Parametry
filefilewymaganyThe PDF to split.
pagesstringopcjonalnyOptional range, e.g. "1,3,5-7".
Zwraca: 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.
Parametry
filefilewymaganyThe PDF to rotate.
angleintopcjonalny90, 180 or 270. Default 90.
Zwraca: 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.pdfKonwersja
/v1/pdf-to-wordPDF to WordConvert a PDF into an editable Word (.docx) document with layout preserved.
Parametry
filefilewymaganyThe PDF to convert.
Zwraca: 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.
Parametry
filefilewymaganyThe document to convert.
Zwraca: 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.
Parametry
filefilewymaganyThe PDF to convert.
qualitystringopcjonalnystandard (150dpi) · high (300) · maximum (600).
Zwraca: 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.
Parametry
filefilewymaganyThe PDF to convert.
qualitystringopcjonalnystandard · high · maximum.
Zwraca: 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).
Parametry
filesfile[]wymaganyOne or more JPG images.
Zwraca: 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).
Parametry
filesfile[]wymaganyOne or more PNG images.
Zwraca: 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.pdfOptymalizacja
/v1/compressCompress PDFReduce a PDF's file size with lossless stream compression.
Parametry
filefilewymaganyThe PDF to compress.
Zwraca: 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.pdfOchrona
/v1/protectProtect PDFEncrypt a PDF with AES-256 so it can only be opened with the password.
Parametry
filefilewymaganyThe PDF to protect.
passwordstringwymaganyPassword required to open the file.
Zwraca: 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.pdfPlany i limity
| Plan | Wywołania API | Cena |
|---|---|---|
| Free | 50 / month | $0 |
| Starter | 1,000 / month | $9/mo |
| Pro | 10,000 / month | $19/mo |
| Max | 100,000 / month | Contact sales |
Limit odnawia się pierwszego dnia każdego miesiąca (UTC). Liczą się tylko udane wywołania. Zobacz pełny cennik →
Kody statusu i błędów
| HTTP | Kod | Znaczenie |
|---|---|---|
| 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. |
Zacznij budować już dziś
Utwórz darmowy klucz API i wykonaj pierwsze wywołanie w mniej niż minutę.
Odbierz klucz API