Skip to main content
POST
/
v1
/
pdf
Generate PDF from a URL (ephemeral browser)
curl --request POST \
  --url https://api.webcompute.dev/v1/pdf \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "proxy": "<string>",
  "waitFor": "<string>",
  "timeout": 30000,
  "policy": {},
  "format": "A4",
  "landscape": false,
  "printBackground": true
}
'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string
required

Target URL to navigate to

proxy
string

Proxy URL (protocol://user:pass@host:port)

waitFor
string

CSS selector to wait for before action

timeout
number
default:30000

Action timeout in milliseconds (1-60000)

policy
object

Browser navigation policy for this action

format
enum<string>
default:A4

Paper size

Available options:
A4,
Letter,
A3,
Tabloid,
Ledger,
Legal
landscape
boolean
default:false

Landscape orientation

printBackground
boolean
default:true

Print background graphics

Response

PDF result (base64 in JSON)