onvert HTML, Markdown or a URL to PDF, take screenshots, extract PDF text and metadata, and merge, split or rotate PDFs.
Includes 10 free calls per month
After the free quota, standard per-request pricing applies via x402 (USDC on Base).
Convert HTML, Markdown or a public URL to a PDF. Send exactly one of html, markdown or url. Set response_mode to json to get the PDF base64-encoded in the response.
Request schema
HTML to convert.
Markdown to convert.
Public web page to convert.
How the result comes back. Always send json or base64.
Suggested file name.
Paper size, for example A4 or Letter.
Response schema
Size in bytes.
The PDF, base64-encoded.
Extract the text of a base64-encoded PDF. Returns JSON with the text; set structured to true for page-by-page text.
Request schema
The PDF, base64-encoded.
true for text per page.
Response schema
All text, when structured is false.
Only when structured is true.
Text per page, only when structured is true.
Read a PDF's metadata (title, author, subject, producer, dates) from pdf_url or pdf_base64. Returns JSON.
Request schema
Public URL of the PDF (instead of pdf_base64).
The PDF, base64-encoded (instead of pdf_url).
Response schema
Document properties found in the PDF.
Extract the text of a PDF at a public URL. Returns JSON with the text; set structured to true for page-by-page text.
Request schema
Public URL of the PDF.
true for text per page.
Response schema
All text, when structured is false.
Only when structured is true.
Text per page, only when structured is true.
Merge two or more PDFs into one. Send pdf_urls or pdf_base64 (a list). Set response_mode to json for a base64 result.
Request schema
Public URLs of the PDFs, in order.
The PDFs, base64-encoded, in order.
How the result comes back. Always send json or base64.
Suggested file name.
Response schema
Size in bytes.
The PDF, base64-encoded.
Rotate PDF pages by 90, 180 or 270 degrees. Send pdf_url or pdf_base64, degrees and optional page_numbers. Set response_mode to json.
Request schema
Public URL of the PDF (instead of pdf_base64).
The PDF, base64-encoded (instead of pdf_url).
1-based pages to rotate; omit for all pages.
How the result comes back. Always send json or base64.
Suggested file name.
Response schema
Size in bytes.
The PDF, base64-encoded.
Split a PDF into single-page PDFs. Send pdf_url or pdf_base64. Set response_mode to json to get each page base64-encoded.
Request schema
Public URL of the PDF (instead of pdf_base64).
The PDF, base64-encoded (instead of pdf_url).
How the result comes back. Always send json or base64.
Suggested file name.
Response schema
One entry per page: file name to base64-encoded single-page PDF.
Capture a PNG or JPEG screenshot of a public URL or of HTML you send. Set response_mode to json to get the image base64-encoded.
Request schema
HTML to render (instead of url).
Public web page (instead of html).
How the result comes back. Always send json or base64.
Viewport width in pixels.
Viewport height in pixels.
true to capture the whole page.
Response schema
The image, base64-encoded.
Capture a screenshot of a public URL or HTML and return it as a one-page PDF. Set response_mode to json for base64 output.
Request schema
HTML to render (instead of url).
Public web page (instead of html).
How the result comes back. Always send json or base64.
Viewport width in pixels.
Viewport height in pixels.
true to capture the whole page.
Response schema
Size in bytes.
The PDF, base64-encoded.
Easiest way: the APIHub CLI. Credits cover x402, no wallet needed.
# install and set up once
npx @apihubio/cli register
npx @apihubio/cli topup 10
# call this service
npx @apihubio/cli call "https://proxy.apihub.io/sarvapdf/pdf/convert" \
-d '{"html":"example html","markdown":"example markdown","url":"example url","response_mode":"json","filename":"example filename","page_format":"example page_format","landscape":true}'Or call the proxy directly (curl / any HTTP client):
curl -X POST https://proxy.apihub.io/sarvapdf/pdf/convert \
-H "Authorization: Bearer ahk_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"example html","markdown":"example markdown","url":"example url","response_mode":"json","filename":"example filename","page_format":"example page_format","landscape":true}'
# If credits available: charged automatically, returns 200
# Otherwise: returns 402 (pay via @x402/fetch or top up credits)Estimate your monthly cost for SarvaPDF APIs.