sellAI
web

Browser Rendering

Open web pages, take screenshots, make PDFs and scrape content — using a headless Chromium that runs on Cloudflare's network.

8+REST endpoints
120Concurrent browsers (Paid)
10 minFree time per day
lightbulb

What is Browser Rendering?

Browser Rendering gives you a headless browser — a real Chromium with no visible window — running on Cloudflare's network. You control it from code to load pages, click, type, screenshot, export PDFs and pull out content.

It works two ways: simple REST API endpoints for one-off jobs (just send a URL, get a screenshot back), or full programmatic control inside a Worker using Puppeteer or Playwright — the popular libraries for driving Chrome.

smart_toy

Think of it like a robot using a browser

Imagine a tireless robot that opens Chrome, visits any page, snaps a photo or saves a PDF, copies the text, and never needs a screen. You hand it instructions in code; it does the clicking. That's Browser Rendering.

help

Why use it?

Running headless Chrome yourself is heavy: it eats memory, crashes, and is hard to scale. Browser Rendering hands you ready browsers on demand, right next to your Workers.

photo_camera

Screenshots & PDFs

Turn any web page into an image or a print-ready PDF — great for previews, receipts or reports.

travel_explore

Scrape dynamic sites

Many pages build their content with JavaScript. A real browser sees the finished page, so you get the actual data.

data_object

Feed AI clean data

Convert pages to clean Markdown or structured JSON, perfect input for Workers AI or a RAG pipeline.

rocket

Scales for you

Spin up many browsers with low cold-start overhead, and reuse sessions to go even faster.

target

When should you use it?

preview

Link previews

Generate thumbnail images of pages for social cards or a dashboard.

receipt_long

PDF documents

Create invoices, tickets or reports from an HTML template, on the fly.

content_paste_search

Data extraction

Collect prices, listings or articles from pages that need JavaScript to render.

checklist_rtl

Automated testing

Drive a real browser to click through and verify that your own site works.

rocket_launch

How do you start?

Quick way: the REST API

For one-off jobs you don't even need a Worker. Send a URL to an endpoint like /screenshot and get the result back. Other endpoints include /pdf, /content, /scrape, /snapshot, /json, /links and /markdown.

bashScreenshot via REST API
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/{account_id}/browser-rendering/screenshot' \
  -H 'Authorization: Bearer {api_token}' \
  -H 'Content-Type: application/json' \
  -d '{ "url": "https://example.com" }' \
  --output screenshot.png

Full control: Puppeteer in a Worker

  1. Install the library

    Add Cloudflare's Puppeteer package to your Worker project.

    bash
    npm install @cloudflare/puppeteer
  2. Add the browser binding

    Declare a browser binding in wrangler.jsonc so env.MYBROWSER is available in code.

    jsonc
    {
      "name": "my-browser-worker",
      "main": "src/index.js",
      "compatibility_date": "2025-06-01",
      "browser": {
        "binding": "MYBROWSER"
      }
    }
  3. Drive the browser

    Launch Chromium, open a page, go to a URL and screenshot it. Always close the browser when done to free resources.

    js
    import puppeteer from "@cloudflare/puppeteer";
    
    export default {
      async fetch(request, env) {
        const browser = await puppeteer.launch(env.MYBROWSER);
        const page = await browser.newPage();
        await page.goto("https://example.com");
        const image = await page.screenshot();
        await browser.close();
        return new Response(image, {
          headers: { "content-type": "image/png" }
        });
      }
    };
  4. Deploy

    Publish your Worker and call it from anywhere.

    bash
    wrangler deploy
school

Key concepts

visibility_off

Headless browser

A full browser running without a visible window — perfect for automation on a server.

integration_instructions

Puppeteer & Playwright

Popular libraries that let your code tell the browser what to click, type and capture.

api

REST API vs Bindings

REST endpoints are quick and code-free; bindings inside a Worker give full step-by-step control.

sync

Sessions

Reuse a warm browser across requests instead of launching a fresh one each time — faster and cheaper.

tips_and_updates

Tips & limits

timer

Always close the browser

Call browser.close() (or reuse a session) when you're done. On the Free plan you get 10 minutes of browser time per day, so leaving browsers open wastes your quota.

  • Free plan: up to 3 concurrent browsers, a new one every 20 seconds, and 10 minutes total per day.
  • Workers Paid plan: up to 120 concurrent browsers and a new one every second.
  • Browsers idle out after 60 seconds by default (extendable up to 10 minutes).
  • Reuse sessions to cut cold starts and stay within limits.