---
title: "Cloudflare Browser Rendering - Headless Browsers for AI Agents"
description: "Headless, programmable web browsers built for AI Agents. Spin up browsers on-demand for screenshots, automation, and web scraping at scale."
url: "https://www.cloudflare.com/products/browser-rendering"
---

# Browser Run

> Give your application web browsing capabilities. Spin up a web browser in the cloud on-demand, and control it with your own code or AI-generated code. Take screenshots, extract text, run tests and automate any workflow — even ones with no API to rely on.

## Key Features

- Playwright & Puppeteer support
- REST API endpoints
- Screenshot generation
- PDF generation
- Markdown extraction
- Global browser pool
- Low cold-start time

## Benefits

### Scale to thousands of browsers

Instant access to a global pool of browsers with low cold-start time — ideal for screenshotting, extracting structured data, or automation at scale.

### Global by Default

Runs on Cloudflare's global network, opening browser sessions close to users for better speed and availability.

### Easy to Integrate

REST APIs for common actions, and works with Playwright and Puppeteer, the best-in-class browser automation libraries

## Use Cases

### Create website thumbnails and social previews using the /screenshot REST API

Generate visual previews for websites and social media sharing

### Power AI agents that need browser-based automation where APIs don't exist

Enable AI agents to interact with web pages and extract data

### Generate PDFs from webpages and HTML content using the /pdf REST API

Convert web content to PDF format for documents and reports

## Code Examples

### Generate screenshots

Take screenshots of web pages using the REST API or Workers bindings. [See docs](https://developers.cloudflare.com/browser-rendering/rest-api/screenshot-endpoint/).

```curl
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' \
  -H 'Authorization: Bearer <apiToken>' \
  -H 'Content-Type: application/json' \
  -d '{
    "html": "Hello World!",
    "screenshotOptions": {
      "omitBackground": true
    }
  }' \
  --output "screenshot.png"
```

### Run Playwright for powering agentic workflows

Use Playwright to automate complex browser interactions for AI agents. [See docs](https://developers.cloudflare.com/browser-rendering/platform/playwright/).

```typescript
import { launch, type BrowserWorker } from "@cloudflare/playwright";

interface Env {
  MYBROWSER: BrowserWorker;
}

export default {
  async fetch(request: Request, env: Env) {
    const browser = await launch(env.MYBROWSER);
    const page = await browser.newPage();

    await page.goto("https://demo.playwright.dev/todomvc");

    const TODO_ITEMS = [
      "buy some cheese",
      "feed the cat",
      "book a doctors appointment",
    ];

    const newTodo = page.getByPlaceholder("What needs to be done?");
    for (const item of TODO_ITEMS) {
      await newTodo.fill(item);
      await newTodo.press("Enter");
    }

    const img = await page.screenshot();
    await browser.close();

    return new Response(img, {
      headers: {
        "Content-Type": "image/png",
      },
    });
  },
};
```

### Retrieve webpage and generate markdown for AI consumption

Extract content from web pages and convert to markdown format for AI processing. [See docs](https://developers.cloudflare.com/browser-rendering/rest-api/markdown-endpoint/).

```curl
curl -X 'POST' 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/markdown' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <apiToken>' \
  -d '{
    "url": "https://example.com"
}'
```

## Resources

- [Full Documentation](https://developers.cloudflare.com/browser-rendering): Complete technical documentation
- [Get Started](https://dash.cloudflare.com/sign-up): Sign up and start building
- [Pricing](/plans.md): See pricing details

## Related Products

- [Cloudflare Pages](/products/pages.md): Build & deploy frontend sites
- [Containers](/products/containers.md): Any language, anywhere
- [Durable Objects](/products/durable-objects.md): Stateful compute
- [Email Service](/products/email-service.md): Send and receive email

---

*This is a markdown version of [https://www.cloudflare.com/products/browser-rendering](https://www.cloudflare.com/products/browser-rendering) for AI/LLM consumption.*
