POST/v1/convert/url

Convert URL to PDF

Render a live page by URL and return a base64-encoded PDF in the response. Ideal for invoices, dashboards, and authenticated web views that already exist as live web pages.

data_object

Parameters

url
stringbodyrequired

Fully-qualified http:// or https:// URL to render.

config
objectbody

Optional render configuration. Include page size, margins, print background, wait conditions, and metadata controls.

bolt

Common URL flow

  1. 1Generate the target URL for the document view.
  2. 2Wait for deterministic UI completion using wait_for_selector or wait_for_expression.
  3. 3Enable print_background for dark or branded pages.
  4. 4Store or stream the decoded PDF bytes from the response.

URL endpoint examples

POST/v1/convert/url
curl -X POST https://api.fastpdf.dev/v1/convert/url \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/invoice/123", "config": { "paper": { "width": "8.5in", "height": "11in" }, "margin": { "top": "1in", "bottom": "1in" }, "print_background": true, "wait_for_selector": "main" }}' \ --output document.pdf
{ "content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago..."}