Browser Rendering
Open web pages, take screenshots, make PDFs and scrape content — using a headless Chromium that runs on Cloudflare's network.
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.
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.
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.
Screenshots & PDFs
Turn any web page into an image or a print-ready PDF — great for previews, receipts or reports.
Scrape dynamic sites
Many pages build their content with JavaScript. A real browser sees the finished page, so you get the actual data.
Feed AI clean data
Convert pages to clean Markdown or structured JSON, perfect input for Workers AI or a RAG pipeline.
Scales for you
Spin up many browsers with low cold-start overhead, and reuse sessions to go even faster.
When should you use it?
Link previews
Generate thumbnail images of pages for social cards or a dashboard.
PDF documents
Create invoices, tickets or reports from an HTML template, on the fly.
Data extraction
Collect prices, listings or articles from pages that need JavaScript to render.
Automated testing
Drive a real browser to click through and verify that your own site works.
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.
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.pngFull control: Puppeteer in a Worker
Install the library
Add Cloudflare's Puppeteer package to your Worker project.
npm install @cloudflare/puppeteerAdd the browser binding
Declare a browser binding in wrangler.jsonc so env.MYBROWSER is available in code.
{ "name": "my-browser-worker", "main": "src/index.js", "compatibility_date": "2025-06-01", "browser": { "binding": "MYBROWSER" } }Drive the browser
Launch Chromium, open a page, go to a URL and screenshot it. Always close the browser when done to free resources.
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" } }); } };Deploy
Publish your Worker and call it from anywhere.
wrangler deploy
Key concepts
Headless browser
A full browser running without a visible window — perfect for automation on a server.
Puppeteer & Playwright
Popular libraries that let your code tell the browser what to click, type and capture.
REST API vs Bindings
REST endpoints are quick and code-free; bindings inside a Worker give full step-by-step control.
Sessions
Reuse a warm browser across requests instead of launching a fresh one each time — faster and cheaper.
Tips & limits
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.
Related products
menu_bookOfficial docsopen_in_new