# Stableflare Browser PDF Renderer

> Stableflare Browser PDF Renderer is a paid API for AI agents from stableflare.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Renders a URL or HTML content in a headless browser and returns a PDF, with support for cookies, authentication, custom viewport, and element selectors

## Facts

- Endpoint: POST https://stableflare.dev/api/browser/pdf
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stableflare-browser-pdf-renderer-b23425b7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_p517yK5xfTQTRna3erKnz

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stableflare-browser-pdf-renderer-b23425b7 -d '<json body>'
```

Example prompt: Can you convert https://example.com/invoice/12345 to a PDF, waiting until the page is fully loaded (networkidle2), with a 1280x800 viewport, and render the full page?

## When to prefer this

Use this endpoint when you need to render a live, JavaScript-heavy webpage (not just static HTML scraping) into PDF format, especially when you need cookie injection, HTTP Basic Auth, custom viewports, or waiting for dynamic elements to load. Prefer this over static HTML-to-PDF converters when the page relies on client-side rendering.

## Known failure modes

- Target URL is unreachable or returns an error — browser navigation fails
- waitForSelector times out if the specified CSS selector never appears
- Invalid URL format causes schema validation failure
- Authentication credentials rejected by target site — page renders unauthenticated
- Viewport or screenshotOptions values out of acceptable range
- Payment of 0.05 USDC not fulfilled — 402 response returned before rendering begins

## How this service works

Render any URL or HTML as a PDF. Supports custom paper size, margins, landscape, and background printing.

## Output

A PDF file of the rendered webpage or HTML content, produced by a headless Chromium browser via Cloudflare Browser Rendering, reflecting the live DOM state including JavaScript-rendered elements

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "URL to render"
  },
  "html": {
   "type": "string",
   "description": "HTML content to render instead of URL"
  },
  "cookies": {
   "type": "array",
   "items": {
    "type": "object",
    "propertyNames": {
     "type": "string"
    },
    "additionalProperties": {}
   }
  },
  "viewport": {
   "type": "object",
   "properties": {
    "width": {
     "type": "number"
    },
    "height": {
     "type": "number"
    },
    "deviceScaleFactor": {
     "type": "number"
    }
   },
   "additionalProperties": false
  },
  "userAgent": {
   "type": "string"
  },
  "pdfOptions": {
   "type": "object",
   "properties": {
    "scale": {
     "type": "number"
    },
    "format": {
     "type": "string",
     "description": "Paper format (e.g. A4, Letter)"
    },
    "margin": {
     "type": "object",
     "properties": {
      "top": {
       "type": "string"
      },
      "left": {
       "type": "string"
      },
      "right": {
       "type": "string"
      },
      "bottom": {
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "landscape": {
     "type": "boolean"
    },
    "printBackground": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  },
  "gotoOptions": {
   "type": "object",
   "properties": {
    "timeout": {
     "type": "number"
    },
    "waitUntil": {
     "enum": [
      "load",
      "domcontentloaded",
      "networkidle0",
      "networkidle2"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "authenticate": {
   "type": "object",
   "required": [
    "username",
    "password"
   ],
   "properties": {
    "password": {
     "type": "string"
    },
    "username": {
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "waitForSelector": {
   "type": "string",
   "description": "CSS selector to wait for"
  },
  "setExtraHTTPHeaders": {
   "type": "object",
   "propertyNames": {
    "type": "string"
   },
   "additionalProperties": {
    "type": "string"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stableflare-browser-pdf-renderer-b23425b7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stableflare.dev](https://www.zero.xyz/host/stableflare.dev/llms.txt)
