Hexloom API / PDF merge API
PDF merge API
Send two to twenty PDFs as multipart fields and get one merged PDF back. Pages keep the order of the fields you send.
POST /api/v1/pdf/merge
Try it without a key
curl -X POST https://hexloomlabs.com/api/v1/pdf/merge -F "file1=@first.pdf" -F "file2=@second.pdf" -o merged.pdf
The keyless demo is limited to 1 MB per call. Please keep to about 10 calls a minute. In Windows PowerShell, type curl.exe instead of curl.
With a RapidAPI key
curl -X POST https://hexloom-file-api.p.rapidapi.com/pdf/merge -H "X-RapidAPI-Key: YOUR_KEY" -F "file1=@first.pdf" -F "file2=@second.pdf" -o merged.pdf
The Basic plan is free: 100 calls a month, 1 MB per call for this endpoint. Paid plans start at $9 a month and allow 10 MB per call. See all plans and prices on RapidAPI.
Request
- Content type:
multipart/form-data, 2 to 20 file fields; any field names; merge order is the order sent. - Output limited to 500 pages.
Responses
200withapplication/pdfbody: the merged file.400 need_two_files: fewer than two PDFs sent.400 empty: no file received.400 bad_multipart: the multipart body could not be read.422 bad_pdf: one of the files is not a readable, unencrypted PDF; the message says which one.415 unsupported_pdf_filter: the PDF uses a stream encoding the service does not accept (LZW, ASCII85, ASCIIHex or RunLength). Re-save it from a PDF viewer.400 too_many_files: more than 20 PDFs sent.413 too_many_pages: the merged output would pass 500 pages.413 too_large,429 rate_limited: see limits.
Errors return JSON: {"ok":false,"error":{"code":"...","message":"..."}}.
What it does not do
It does not repair damaged PDFs, remove passwords or run OCR.
What we keep
File contents are held in memory for the length of the request and are not stored or logged by this service. Cloudflare, which hosts it, keeps its usual request logs (time, path, size, IP and request headers; key and secret headers are masked). See the privacy policy and terms. Questions: support.