← Back to marketplace

SarvaPDF APIs

onvert HTML, Markdown or a URL to PDF, take screenshots, extract PDF text and metadata, and merge, split or rotate PDFs.

data
by sarvasoft_opc9 endpoints100% uptime305ms avg

Includes 10 free calls per month

After the free quota, standard per-request pricing applies via x402 (USDC on Base).

Endpoints

POST/pdf/convert
$0.0500/req

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

htmlstring

HTML to convert.

markdownstring

Markdown to convert.

urlstring

Public web page to convert.

response_modestringrequired

How the result comes back. Always send json or base64.

filenamestring

Suggested file name.

page_formatstring

Paper size, for example A4 or Letter.

landscapeboolean

Response schema

filenamestringrequired
sizeintegerrequired

Size in bytes.

created_atstringrequired
pdf_base64stringrequired

The PDF, base64-encoded.

POST/pdf/extract/base64
$0.0500/req

Extract the text of a base64-encoded PDF. Returns JSON with the text; set structured to true for page-by-page text.

Request schema

pdf_base64stringrequired

The PDF, base64-encoded.

structuredboolean

true for text per page.

Response schema

textstring

All text, when structured is false.

page_countinteger

Only when structured is true.

pagesarray

Text per page, only when structured is true.

POST/pdf/extract/metadata
$0.0500/req

Read a PDF's metadata (title, author, subject, producer, dates) from pdf_url or pdf_base64. Returns JSON.

Request schema

pdf_urlstring

Public URL of the PDF (instead of pdf_base64).

pdf_base64string

The PDF, base64-encoded (instead of pdf_url).

Response schema

metadataobjectrequired

Document properties found in the PDF.

POST/pdf/extract/url
$0.0500/req

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

pdf_urlstringrequired

Public URL of the PDF.

structuredboolean

true for text per page.

Response schema

textstring

All text, when structured is false.

page_countinteger

Only when structured is true.

pagesarray

Text per page, only when structured is true.

POST/pdf/merge
$0.0500/req

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

pdf_urlsarray

Public URLs of the PDFs, in order.

pdf_base64array

The PDFs, base64-encoded, in order.

response_modestringrequired

How the result comes back. Always send json or base64.

filenamestring

Suggested file name.

Response schema

filenamestringrequired
sizeintegerrequired

Size in bytes.

created_atstringrequired
pdf_base64stringrequired

The PDF, base64-encoded.

POST/pdf/rotate
$0.0500/req

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

pdf_urlstring

Public URL of the PDF (instead of pdf_base64).

pdf_base64string

The PDF, base64-encoded (instead of pdf_url).

degreesintegerrequired
page_numbersarray

1-based pages to rotate; omit for all pages.

response_modestringrequired

How the result comes back. Always send json or base64.

filenamestring

Suggested file name.

Response schema

filenamestringrequired
sizeintegerrequired

Size in bytes.

created_atstringrequired
pdf_base64stringrequired

The PDF, base64-encoded.

POST/pdf/split
$0.0500/req

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

pdf_urlstring

Public URL of the PDF (instead of pdf_base64).

pdf_base64string

The PDF, base64-encoded (instead of pdf_url).

response_modestringrequired

How the result comes back. Always send json or base64.

filenamestring

Suggested file name.

Response schema

page_countintegerrequired
pagesobjectrequired

One entry per page: file name to base64-encoded single-page PDF.

POST/screenshot
$0.0500/req

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

htmlstring

HTML to render (instead of url).

urlstring

Public web page (instead of html).

response_modestringrequired

How the result comes back. Always send json or base64.

widthinteger

Viewport width in pixels.

heightinteger

Viewport height in pixels.

full_pageboolean

true to capture the whole page.

image_formatstring

Response schema

filenamestringrequired
sizeintegerrequired
created_atstringrequired
image_base64stringrequired

The image, base64-encoded.

POST/screenshot/pdf
$0.0500/req

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

htmlstring

HTML to render (instead of url).

urlstring

Public web page (instead of html).

response_modestringrequired

How the result comes back. Always send json or base64.

widthinteger

Viewport width in pixels.

heightinteger

Viewport height in pixels.

full_pageboolean

true to capture the whole page.

Response schema

filenamestringrequired
sizeintegerrequired

Size in bytes.

created_atstringrequired
pdf_base64stringrequired

The PDF, base64-encoded.

Quick start

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)

Pricing calculator

Estimate your monthly cost for SarvaPDF APIs.

POST /pdf/convert$0.0500/req
-
POST /pdf/extract/base64$0.0500/req
-
POST /pdf/extract/metadata$0.0500/req
-
POST /pdf/extract/url$0.0500/req
-
POST /pdf/merge$0.0500/req
-
POST /pdf/rotate$0.0500/req
-
POST /pdf/split$0.0500/req
-
POST /screenshot$0.0500/req
-
POST /screenshot/pdf$0.0500/req
-