Generate PDFs from HTML, URLs, Markdown, or templates. One endpoint, multiple input modes, instant output.
https://pdf-api-fmard.vercel.appX-API-Key: your_key (header) or ?key=your_key (query)
Get your free key below
/api/generate
Generate a PDF from HTML, URL, Markdown, or a named template.
Content-Type
application/json
yes
JSON request body
X-API-Key
your_key
yes
Your API key
html
string
no
Raw HTML content to convert
url
string
no
Public URL to convert to PDF
markdown
string
no
Markdown text to convert
template
string
no
Template name (e.g. "invoice", "resume")
data
object
no
Template variables / data object
options.format
string
no
Paper format: A3, A4, A5, Letter, Legal. Default: A4
options.landscape
boolean
no
Landscape orientation. Default: false
options.printBackground
boolean
no
Print background graphics. Default: true
options.margin
object
no
Page margins (top, right, bottom, left)
css
string
no
Custom CSS to inject
watermark
string
no
Watermark text overlay
application/pdf// 400 — Bad Request
{ "error": "No input provided. Use html, url, markdown, or template." }
// 401 — Unauthorized
{ "error": "Invalid API key" }
// 429 — Rate Limited
{ "error": "Daily limit reached. Upgrade your plan." }
Get a free API key for 6 requests/day. No credit card required.
X-API-Key: your_key?key=your_keyStart free. Pay only when you need more.
No monthly commitment. Pay only for what you use. All features included.