Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@
/bots/reference/verified-bot-policy/ /bots/concepts/bot/verified-bots/policy/ 301

#browser-rendering
/browser-rendering/get-started/browser-rendering-with-do/ /browser-rendering/workers-binding-api/browser-rendering-with-do/ 301
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-binding-api/reuse-sessions/ 301
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-binding-api/screenshots/ 301
/browser-rendering/get-started/browser-rendering-with-do/ /browser-rendering/workers-binding-api/browser-rendering-with-do/ 301
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-binding-api/reuse-sessions/ 301
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-binding-api/screenshots/ 301

# byoip
/byoip/about/dynamic-advertisement/ /byoip/concepts/dynamic-advertisement/ 301
Expand Down Expand Up @@ -436,7 +436,7 @@
/cloudflare-one/insights/email-monitoring/ /cloudflare-one/email-security/email-monitoring/ 301
/cloudflare-one/insights/email-monitoring/search-email/ /cloudflare-one/email-security/email-monitoring/search-email/ 301
/cloudflare-one/insights/email-monitoring/phish-submissions/ /cloudflare-one/email-security/phish-submissions/ 301
/cloudflare-one/insights/email-monitoring/enable-logs/ /cloudflare-one/insights/logs/enable-logs/ 301
/cloudflare-one/insights/email-monitoring/enable-logs/ /cloudflare-one/insights/logs/enable-logs/ 301


# firewall
Expand Down Expand Up @@ -1874,6 +1874,7 @@

### DYNAMIC REDIRECTS ###
/changelog-next/* /changelog/:splat 301
/browser-rendering/quick-actions-rest-api/* /browser-rendering/rest-api/:splat 301
/*/sitemap.xml /sitemap-index.xml 301
/access/configuring-identity-providers/* /cloudflare-one/identity/idp-integration/:splat 301
/api-security/* /api-shield/:splat 301
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: New REST API is in open beta!
description: We've released a new REST API in open beta.
products:
- browser-rendering
date: 2025-02-27T12:00:00Z
---

We've released a new REST API for [Browser Rendering](/browser-rendering/) in open beta, making interacting with browsers easier than ever. This new API provides endpoints for common browser actions, with more to be added in the future.

With the **REST API** you can:

- **Capture screenshots** – Use `/screenshot` to take a screenshot of a webpage from provided URL or HTML.
- **Generate PDFs** – Use `/pdf` to convert web pages into PDFs.
- **Extract HTML content** – Use `/content` to retrieve the full HTML from a page.
**Snapshot (HTML + Screenshot)** – Use `/snapshot` to capture both the page's HTML and a screenshot in one request
- **Scrape Web Elements** – Use `/scrape` to extract specific elements from a page.

For example, to capture a screenshot:

```bash title="Screenshot example"
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": {
"type": "webp",
"omitBackground": true
}
}' \
--output "screenshot.webp"
```

Learn more in our [documentation](/browser-rendering/rest-api/).
2 changes: 1 addition & 1 deletion src/content/docs/browser-rendering/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sidebar:
Browser rendering can be used in two ways:

- [Workers Binding API](/browser-rendering/workers-binding-api) for complex scripts.
- [Quick Actions REST API](/browser-rendering/quick-actions-rest-api/) for simple actions.
- [REST API](/browser-rendering/rest-api/) for simple actions.

This file was deleted.

23 changes: 23 additions & 0 deletions src/content/docs/browser-rendering/rest-api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
pcx_content_type: navigation
title: REST API
sidebar:
order: 2
group:
badge: Beta
---

The REST API is a RESTful interface that provides endpoints for common browser actions such as capturing screenshots, extracting HTML content, generating PDFs, and more.
The following are the available options:

import { DirectoryListing } from "~/components";

<DirectoryListing />

Use the REST API when you need a fast, simple way to perform common browser tasks such as capturing screenshots, extracting HTML, or generating PDFs without writing complex scripts. If you require more advanced automation, custom workflows, or persistent browser sessions, the [Workers Binding API](/browser-rendering/workers-binding-api/) is the better choice.

## Before you begin

Before you begin, make sure you [create a custom API Token](/fundamentals/api/get-started/create-token/) with the following permissions:

- `Browser Rendering - Edit`
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ The Workers Binding API allows you to execute advanced browser rendering scripts

<DirectoryListing />

Use the Workers Binding API when you need advanced browser automation, custom workflows, or complex interactions beyond basic rendering. For quick, one-off tasks like capturing screenshots or extracting HTML, the [Quick Actions REST API](/browser-rendering/quick-actions-rest-api/) is the simpler choice.
Use the Workers Binding API when you need advanced browser automation, custom workflows, or complex interactions beyond basic rendering. For quick, one-off tasks like capturing screenshots or extracting HTML, the [REST API](/browser-rendering/rest-api/) is the simpler choice.
Loading