Developer API

Convert any public webpage to a PDF programmatically. JSON in, PDF URL out.

Authentication

Every request needs an Authorization header with a bearer token. Generate a key from your account page. Keys are shown once at creation and can be revoked at any time.

Authorization: Bearer utp_live_...

Convert a URL to PDF

POST https://urltopdf.org/api/public/v1/convert

Send a JSON body describing the page and the options you want.

curl -X POST https://urltopdf.org/api/public/v1/convert \
  -H "Authorization: Bearer utp_live_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "A4",
    "landscape": false,
    "background_graphics": true
  }'

Request body

  • url (required), a publichttp/https URL.
  • format (optional, default "A4"), "A4" or "Letter".
  • landscape (optional, default false).
  • background_graphics (optional, default true), render background colors and images.

Success response (200)

{
  "success": true,
  "pdf_url": "https://.../api-pdfs/....pdf?token=...",
  "expires_at": "2026-07-21T09:00:00.000Z"
}

The pdf_url is a signed URL valid for 7 days. Download and store the PDF on your own infrastructure if you need it for longer.

Error response

{
  "success": false,
  "error": "Invalid or revoked API key"
}

Error codes

  • 400, missing or invalid url, or malformed JSON body
  • 401, missing, invalid, or revoked API key
  • 429, per-minute rate limit exceeded (5 req/min per key) or monthly call cap reached
  • 502, upstream render failed (e.g. page took too long, blocked robots, network error)
  • 500, internal error

Rate limits

  • 5 requests per minute, per key
  • 1,000 calls per month, per key (rolling 30-day window)

Both limits return HTTP 429 with a JSON body explaining which limit was hit and (for the monthly cap) when it resets.

Get started

Create an API key from your account page, then send your first request with the curl example above.

MCP server (for AI agents)

urltopdf ships a Model Context Protocol server at https://urltopdf.org/api/mcp. It exposes a single narrow tool, convert_url_to_pdf, deliberately not a kitchen-sink PDF toolkit. Point any MCP-compatible client (Claude Desktop, Cursor, ChatGPT connectors, etc.) at the URL and pass your API key in the Authorization header.

{
  "mcpServers": {
    "urltopdf": {
      "url": "https://urltopdf.org/api/mcp",
      "headers": {
        "Authorization": "Bearer utp_live_YOUR_KEY_HERE"
      }
    }
  }
}

Tool inputs: url (required), format, landscape, background_graphics. Returns { pdf_url, expires_at }. Same Developer-plan gate, rate limits, and monthly cap as the REST API.