SmallPDF.us
API para Desenvolvedores · v1

A API de PDF criada para desenvolvedores

Um simples endpoint REST por tarefa. Mescle, converta, comprima e proteja PDFs de qualquer linguagem — sem SDK, sem servidores, sem bibliotecas PDF.

11 endpoints
PDF, Word e imagens
Sem SDK
HTTP simples + multipart
Privado
Verificado e excluído auto.
Qualquer linguagem
cURL, Node, Python…

Início rápido

1. Obtenha uma chave

Entre e crie uma chave no seu painel.

2. Chame um endpoint

Envie seu arquivo como multipart/form-data.

3. Obtenha o resultado

O arquivo processado é retornado instantaneamente.

Request
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

Autenticação

Cada requisição deve incluir sua chave secreta no cabeçalho X-API-Key . Crie e gerencie chaves no seu painel. Mantenha as chaves no lado do servidor — nunca as exponha no código do cliente.

Request
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxx

URL base e respostas

Todos os endpoints são POST sob:

https://smallpdf.us/api/v1
  • Em caso de sucesso, o arquivo processado é retornado diretamente no corpo.
  • Em caso de erro, um corpo JSON é retornado: { "error": "...", "code": "..." }
  • Cada resposta inclui X-RateLimit-Limit / X-RateLimit-Remaining
  • Os uploads são verificados quanto a malware e excluídos dos nossos servidores imediatamente após o processamento.

Endpoints

Organizar

POST/v1/mergeMerge PDF

Combine two or more PDFs into a single document, in the order provided.

Parâmetros

filesfile[]obrigatório

Two or more PDF files.

Retorna: PDF file · merged.pdf

Request
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
POST/v1/splitSplit PDF

Split a PDF. Without `pages` you receive a ZIP with one PDF per page; with `pages` you receive a single PDF of just those pages.

Parâmetros

filefileobrigatório

The PDF to split.

pagesstringopcional

Optional range, e.g. "1,3,5-7".

Retorna: PDF file · split.pdf

Request
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
POST/v1/rotateRotate PDF

Rotate every page by a multiple of 90 degrees.

Parâmetros

filefileobrigatório

The PDF to rotate.

angleintopcional

90, 180 or 270. Default 90.

Retorna: PDF file · rotated.pdf

Request
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.pdf

Converter

POST/v1/pdf-to-wordPDF to Word

Convert a PDF into an editable Word (.docx) document with layout preserved.

Parâmetros

filefileobrigatório

The PDF to convert.

Retorna: Word .docx file · converted.docx

Request
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
POST/v1/word-to-pdfWord to PDF

Convert a Word document (.doc, .docx, .odt, .rtf) into a PDF.

Parâmetros

filefileobrigatório

The document to convert.

Retorna: PDF file · converted.pdf

Request
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
POST/v1/pdf-to-jpgPDF to JPG

Render each PDF page to a JPG image. Returns a ZIP archive.

Parâmetros

filefileobrigatório

The PDF to convert.

qualitystringopcional

standard (150dpi) · high (300) · maximum (600).

Retorna: ZIP archive of images · pages.zip

Request
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
POST/v1/pdf-to-pngPDF to PNG

Render each PDF page to a PNG image. Returns a ZIP archive.

Parâmetros

filefileobrigatório

The PDF to convert.

qualitystringopcional

standard · high · maximum.

Retorna: ZIP archive of images · pages.zip

Request
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
POST/v1/jpg-to-pdfJPG to PDF

Combine one or more JPG images into a single PDF (one image per page).

Parâmetros

filesfile[]obrigatório

One or more JPG images.

Retorna: PDF file · images.pdf

Request
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
POST/v1/png-to-pdfPNG to PDF

Combine one or more PNG images into a single PDF (one image per page).

Parâmetros

filesfile[]obrigatório

One or more PNG images.

Retorna: PDF file · images.pdf

Request
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.pdf

Otimizar

POST/v1/compressCompress PDF

Reduce a PDF's file size with lossless stream compression.

Parâmetros

filefileobrigatório

The PDF to compress.

Retorna: PDF file · compressed.pdf

Request
curl -X POST https://smallpdf.us/api/v1/compress \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@input.pdf" \
  -o compressed.pdf

Proteger

POST/v1/protectProtect PDF

Encrypt a PDF with AES-256 so it can only be opened with the password.

Parâmetros

filefileobrigatório

The PDF to protect.

passwordstringobrigatório

Password required to open the file.

Retorna: PDF file · protected.pdf

Request
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.pdf

Planos e cota

PlanoChamadas APIPreço
Free50 / month$0
Starter1,000 / month$9/mo
Pro10,000 / month$19/mo
Max100,000 / monthContact sales

A cota é redefinida no dia 1 de cada mês (UTC). Apenas chamadas bem-sucedidas são contadas. Ver preços completos

Códigos de status e erro

HTTPCódigoSignificado
200Success. The processed file is returned in the body.
400BAD_INPUTMissing or invalid file / parameters.
401NO_API_KEY · BAD_API_KEYMissing, invalid or revoked key.
429QUOTA_EXCEEDEDMonthly quota used up — upgrade your plan.
500PROCESSING_ERRORThe file could not be processed.

Comece a desenvolver hoje

Crie uma chave API gratuita e faça sua primeira chamada em menos de um minuto.

Obter sua chave API