Docs

Quickstart: curl

Use these curl examples when you want raw HTTP against https://api.relaypdf.com. The JSON body fields are the same as the official SDKs.

Use curl with bearer auth and JSON body.

HTML to PDF

Basic binary output.

POST /v1/pdf
curl https://api.relaypdf.com/v1/pdf \
  -H "Authorization: Bearer pdf_live_..." \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Hello</h1>","filename":"hello.pdf"}' \
  --output hello.pdf

Markdown to PDF

Same endpoint, markdown source.

POST /v1/pdf
curl https://api.relaypdf.com/v1/pdf \
  -H "Authorization: Bearer pdf_live_..." \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Hello from Markdown"}' \
  --output hello.pdf

Screenshot

URL to PNG.

POST /v1/images
curl https://api.relaypdf.com/v1/images \
  -H "Authorization: Bearer pdf_live_..." \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","options":{"fullPage":true}}' \
  --output page.png