# Cloudflare Browser Rendering

Cloudflare Browser Rendering enables developers to programmatically control and interact with headless browser instances running on Cloudflare’s global network, facilitating tasks such as automating browser interactions, capturing screenshots, generating PDFs, and extracting data from web pages.

- **Category:** ai web scraping
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 4
- **Triggers:** 0
- **Slug:** `CLOUDFLARE_BROWSER_RENDERING`
- **Version:** 20260319_00

## Tools

### Capture Screenshot

**Slug:** `CLOUDFLARE_BROWSER_RENDERING_CAPTURE_SCREENSHOT`

Tool to capture a webpage screenshot. Use when you need a visual snapshot of a URL or HTML with optional viewport and clipping. Always validate screenshot content — the tool returns a successful result even when the captured page is a 404 or error page, with no error signal raised.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | URL of the page to capture; required if `html` is unset |
| `html` | string | No | Raw HTML content to render; required if `url` is unset |
| `cacheTTL` | integer | No | Cache TTL in seconds (0 disables cache) |
| `viewport` | object | No | Viewport dimensions |
| `account_id` | string | Yes | Cloudflare account identifier |
| `screenshotOptions` | object | No | Screenshot options like fullPage or clip |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Accounts

**Slug:** `CLOUDFLARE_BROWSER_RENDERING_LIST_ACCOUNTS`

List all Cloudflare accounts accessible to the authenticated API token. Returns account IDs, names, types, and settings. Use this to retrieve a valid account_id required by other browser-rendering actions like capture_screenshot, scrape_html_elements, and take_webpage_snapshot.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | Filter accounts by name using partial/substring match. Case-insensitive. |
| `page` | integer | No | Page number for pagination (1-indexed). Use with per_page to navigate through results. |
| `per_page` | integer | No | Number of accounts to return per page. Valid range: 5-50. Default: 20. |
| `direction` | string ("asc" | "desc") | No | Sort direction for results ordering. Use 'asc' for ascending (A-Z, oldest first) or 'desc' for descending (Z-A, newest first). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Scrape HTML Elements

**Slug:** `CLOUDFLARE_BROWSER_RENDERING_SCRAPE_HTML_ELEMENTS`

Tool to scrape HTML elements for text, HTML, attributes, and box metrics. Use when you need detailed data of matched selectors after rendering a page.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | URL of the webpage to navigate and scrape. Either 'url' or 'html' must be provided. |
| `html` | string | No | Inline HTML content to render and scrape. Either 'url' or 'html' must be provided. |
| `cacheTTL` | integer | No | Cache TTL in seconds (0-86400). Default is 5 seconds. Set to 0 to disable caching. |
| `elements` | array | Yes | List of CSS selectors to scrape. At least one selector is required. |
| `account_id` | string | Yes | Cloudflare Account ID (32-character hexadecimal string). Use List Accounts to retrieve valid IDs. |
| `actionTimeout` | integer | No | Maximum time to wait after page load in milliseconds (0-300000). Use for JavaScript-heavy pages. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Take Webpage Snapshot

**Slug:** `CLOUDFLARE_BROWSER_RENDERING_TAKE_WEBPAGE_SNAPSHOT`

Capture both rendered HTML content and a screenshot of a webpage in a single request. Returns the full DOM content as a string and a Base64-encoded screenshot image. Useful when you need both visual representation and page content for analysis.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | URL of the webpage to capture. Either 'url' or 'html' must be provided. |
| `html` | string | No | Raw HTML content to render and capture. Use this instead of 'url' when you have HTML directly. |
| `cookies` | array | No | List of cookies to set before navigation |
| `cacheTTL` | integer | No | Cache TTL in seconds (0 disables caching, max 86400) |
| `viewport` | object | No | Viewport dimensions and device emulation |
| `userAgent` | string | No | Custom user agent string |
| `account_id` | string | No | Cloudflare account identifier. Optional - the account is typically derived from the API connection configuration. |
| `addStyleTag` | array | No | Styles to inject into the page |
| `bestAttempt` | boolean | No | Continue even if certain events fail |
| `gotoOptions` | object | No | Navigation settings before snapshot |
| `addScriptTag` | array | No | Scripts to inject into the page |
| `authenticate` | object | No | HTTP authentication credentials |
| `actionTimeout` | integer | No | Max time in ms for post-load actions |
| `waitForTimeout` | integer | No | Wait time in ms before proceeding |
| `waitForSelector` | object | No | Wait for an element before snapshot |
| `emulateMediaType` | string | No | Emulate CSS media type (e.g., 'print') |
| `screenshotOptions` | object | No | Options controlling screenshot capture |
| `allowResourceTypes` | array | No | Allowed resource types |
| `allowRequestPattern` | array | No | Regex patterns to allow requests |
| `rejectResourceTypes` | array | No | Blocked resource types |
| `setExtraHTTPHeaders` | object | No | Additional HTTP headers for navigation |
| `rejectRequestPattern` | array | No | Regex patterns to block requests |
| `setJavaScriptEnabled` | boolean | No | Enable or disable JavaScript execution |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
