Skip to content

Commit 5220003

Browse files
kathaylmeddullakodster28
authored
Create rest-api-beta (#20343)
* Create rest-api-beta new wording * Update rest-api-beta fixed date * Update src/content/changelog/browser-rendering/rest-api-beta Co-authored-by: Sofia <[email protected]> * Update and rename rest-api-beta to 2025-02-27-br-rest-api-beta.mdx renamed title * Update 2025-02-27-br-rest-api-beta.mdx fixed title * Update 2025-02-27-br-rest-api-beta.mdx * Updated url and name --------- Co-authored-by: Sofia <[email protected]> Co-authored-by: kodster28 <[email protected]>
1 parent 0c43286 commit 5220003

File tree

11 files changed

+65
-29
lines changed

11 files changed

+65
-29
lines changed

public/_redirects

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@
180180
/bots/reference/verified-bot-policy/ /bots/concepts/bot/verified-bots/policy/ 301
181181

182182
#browser-rendering
183-
/browser-rendering/get-started/browser-rendering-with-do/ /browser-rendering/workers-binding-api/browser-rendering-with-do/ 301
184-
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-binding-api/reuse-sessions/ 301
185-
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-binding-api/screenshots/ 301
183+
/browser-rendering/get-started/browser-rendering-with-do/ /browser-rendering/workers-binding-api/browser-rendering-with-do/ 301
184+
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-binding-api/reuse-sessions/ 301
185+
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-binding-api/screenshots/ 301
186186

187187
# byoip
188188
/byoip/about/dynamic-advertisement/ /byoip/concepts/dynamic-advertisement/ 301
@@ -436,7 +436,7 @@
436436
/cloudflare-one/insights/email-monitoring/ /cloudflare-one/email-security/email-monitoring/ 301
437437
/cloudflare-one/insights/email-monitoring/search-email/ /cloudflare-one/email-security/email-monitoring/search-email/ 301
438438
/cloudflare-one/insights/email-monitoring/phish-submissions/ /cloudflare-one/email-security/phish-submissions/ 301
439-
/cloudflare-one/insights/email-monitoring/enable-logs/ /cloudflare-one/insights/logs/enable-logs/ 301
439+
/cloudflare-one/insights/email-monitoring/enable-logs/ /cloudflare-one/insights/logs/enable-logs/ 301
440440

441441

442442
# firewall
@@ -1874,6 +1874,7 @@
18741874

18751875
### DYNAMIC REDIRECTS ###
18761876
/changelog-next/* /changelog/:splat 301
1877+
/browser-rendering/quick-actions-rest-api/* /browser-rendering/rest-api/:splat 301
18771878
/*/sitemap.xml /sitemap-index.xml 301
18781879
/access/configuring-identity-providers/* /cloudflare-one/identity/idp-integration/:splat 301
18791880
/api-security/* /api-shield/:splat 301
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: New REST API is in open beta!
3+
description: We've released a new REST API in open beta.
4+
products:
5+
- browser-rendering
6+
date: 2025-02-27T12:00:00Z
7+
---
8+
9+
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.
10+
11+
With the **REST API** you can:
12+
13+
- **Capture screenshots** – Use `/screenshot` to take a screenshot of a webpage from provided URL or HTML.
14+
- **Generate PDFs** – Use `/pdf` to convert web pages into PDFs.
15+
- **Extract HTML content** – Use `/content` to retrieve the full HTML from a page.
16+
**Snapshot (HTML + Screenshot)** – Use `/snapshot` to capture both the page's HTML and a screenshot in one request
17+
- **Scrape Web Elements** – Use `/scrape` to extract specific elements from a page.
18+
19+
For example, to capture a screenshot:
20+
21+
```bash title="Screenshot example"
22+
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' \
23+
-H 'Authorization: Bearer <apiToken>' \
24+
-H 'Content-Type: application/json' \
25+
-d '{
26+
"html": "Hello World!",
27+
"screenshotOptions": {
28+
"type": "webp",
29+
"omitBackground": true
30+
}
31+
}' \
32+
--output "screenshot.webp"
33+
```
34+
35+
Learn more in our [documentation](/browser-rendering/rest-api/).

src/content/docs/browser-rendering/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ sidebar:
88
Browser rendering can be used in two ways:
99

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

src/content/docs/browser-rendering/quick-actions-rest-api/index.mdx

Lines changed: 0 additions & 23 deletions
This file was deleted.
File renamed without changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
pcx_content_type: navigation
3+
title: REST API
4+
sidebar:
5+
order: 2
6+
group:
7+
badge: Beta
8+
---
9+
10+
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.
11+
The following are the available options:
12+
13+
import { DirectoryListing } from "~/components";
14+
15+
<DirectoryListing />
16+
17+
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.
18+
19+
## Before you begin
20+
21+
Before you begin, make sure you [create a custom API Token](/fundamentals/api/get-started/create-token/) with the following permissions:
22+
23+
- `Browser Rendering - Edit`
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)