From 4958eeb57b9961e213e575e41e8176128d0cced6 Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:08:11 -0800 Subject: [PATCH 1/7] Create rest-api-beta new wording --- .../changelog/browser-rendering/rest-api-beta | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/content/changelog/browser-rendering/rest-api-beta diff --git a/src/content/changelog/browser-rendering/rest-api-beta b/src/content/changelog/browser-rendering/rest-api-beta new file mode 100644 index 000000000000000..5f04ab783d41684 --- /dev/null +++ b/src/content/changelog/browser-rendering/rest-api-beta @@ -0,0 +1,34 @@ +--- +title: Increased Browser Rendering limits! +description: Browser Rendering now supports more concurrent browser sessions. +products: + - browser-rendering +date: 2025-02-26T10:00:00Z +--- + +We've released a new Quick Actions 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 **Quick Actions 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 `/screenshot` 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//browser-rendering/screenshot' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "html": "Hello World!", + "screenshotOptions": { + "type": "webp", + "omitBackground": true + } + }' \ + --output "screenshot.webp" +``` + +Learn more in our [documentation](/browser-rendering/quick-actions-rest-api/) From ea37c083dbe8b79e9822d324d4bb6d0799a3f1fd Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:12:19 -0800 Subject: [PATCH 2/7] Update rest-api-beta fixed date --- src/content/changelog/browser-rendering/rest-api-beta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/browser-rendering/rest-api-beta b/src/content/changelog/browser-rendering/rest-api-beta index 5f04ab783d41684..815b8a187a1c032 100644 --- a/src/content/changelog/browser-rendering/rest-api-beta +++ b/src/content/changelog/browser-rendering/rest-api-beta @@ -3,7 +3,7 @@ title: Increased Browser Rendering limits! description: Browser Rendering now supports more concurrent browser sessions. products: - browser-rendering -date: 2025-02-26T10:00:00Z +date: 2025-02-27T10:00:00Z --- We've released a new Quick Actions 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. From f6262f99f3b13ec9d182917897ea204b2f502f58 Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Thu, 27 Feb 2025 07:53:21 -0800 Subject: [PATCH 3/7] Update src/content/changelog/browser-rendering/rest-api-beta Co-authored-by: Sofia --- src/content/changelog/browser-rendering/rest-api-beta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/changelog/browser-rendering/rest-api-beta b/src/content/changelog/browser-rendering/rest-api-beta index 815b8a187a1c032..e1661fe32276340 100644 --- a/src/content/changelog/browser-rendering/rest-api-beta +++ b/src/content/changelog/browser-rendering/rest-api-beta @@ -12,7 +12,7 @@ With the **Quick Actions 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 `/screenshot` to capture both the page's HTML and a screenshot in one request + **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: From 399177821baeb51a7f7e658acfdca561aaa52bab Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Thu, 27 Feb 2025 08:15:43 -0800 Subject: [PATCH 4/7] Update and rename rest-api-beta to 2025-02-27-br-rest-api-beta.mdx renamed title --- .../{rest-api-beta => 2025-02-27-br-rest-api-beta.mdx} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/content/changelog/browser-rendering/{rest-api-beta => 2025-02-27-br-rest-api-beta.mdx} (98%) diff --git a/src/content/changelog/browser-rendering/rest-api-beta b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx similarity index 98% rename from src/content/changelog/browser-rendering/rest-api-beta rename to src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx index e1661fe32276340..83dccfe32b08da9 100644 --- a/src/content/changelog/browser-rendering/rest-api-beta +++ b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx @@ -31,4 +31,4 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts//browser- --output "screenshot.webp" ``` -Learn more in our [documentation](/browser-rendering/quick-actions-rest-api/) +Learn more in our [documentation](/browser-rendering/quick-actions-rest-api/). From a5bb244d3fd95a00a5dc33729be1c5e4c7c8a680 Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Thu, 27 Feb 2025 10:17:25 -0800 Subject: [PATCH 5/7] Update 2025-02-27-br-rest-api-beta.mdx fixed title --- .../browser-rendering/2025-02-27-br-rest-api-beta.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx index 83dccfe32b08da9..b1893e1b8428a0c 100644 --- a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx +++ b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx @@ -1,9 +1,9 @@ --- -title: Increased Browser Rendering limits! -description: Browser Rendering now supports more concurrent browser sessions. +title: New Quick Actions REST API is in open beta! +description: We've released a new Quick Actions REST API in open beta. products: - browser-rendering -date: 2025-02-27T10:00:00Z +date: 2025-02-27T12:00:00Z --- We've released a new Quick Actions 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. From ffc9d166889128eb23296998b7b131a8ad67986e Mon Sep 17 00:00:00 2001 From: Kathy <153706637+kathayl@users.noreply.github.com> Date: Thu, 27 Feb 2025 12:38:55 -0800 Subject: [PATCH 6/7] Update 2025-02-27-br-rest-api-beta.mdx --- .../browser-rendering/2025-02-27-br-rest-api-beta.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx index b1893e1b8428a0c..a12587b9d0c7b98 100644 --- a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx +++ b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx @@ -1,14 +1,14 @@ --- -title: New Quick Actions REST API is in open beta! -description: We've released a new Quick Actions REST API in open beta. +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 Quick Actions 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. +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 **Quick Actions REST API** you can: +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. From 7056db6149f31d6a189ac746ce7ee6b48a815c2f Mon Sep 17 00:00:00 2001 From: kodster28 Date: Thu, 27 Feb 2025 14:45:56 -0600 Subject: [PATCH 7/7] Updated url and name --- public/_redirects | 9 ++++---- .../2025-02-27-br-rest-api-beta.mdx | 7 +++--- .../docs/browser-rendering/get-started.mdx | 2 +- .../quick-actions-rest-api/index.mdx | 23 ------------------- .../content-endpoint.mdx | 0 .../docs/browser-rendering/rest-api/index.mdx | 23 +++++++++++++++++++ .../pdf-endpoint.mdx | 0 .../scrape-endpoint.mdx | 0 .../screenshot-endpoint.mdx | 0 .../snapshot.mdx | 0 .../workers-binding-api/index.mdx | 2 +- 11 files changed, 34 insertions(+), 32 deletions(-) delete mode 100644 src/content/docs/browser-rendering/quick-actions-rest-api/index.mdx rename src/content/docs/browser-rendering/{quick-actions-rest-api => rest-api}/content-endpoint.mdx (100%) create mode 100644 src/content/docs/browser-rendering/rest-api/index.mdx rename src/content/docs/browser-rendering/{quick-actions-rest-api => rest-api}/pdf-endpoint.mdx (100%) rename src/content/docs/browser-rendering/{quick-actions-rest-api => rest-api}/scrape-endpoint.mdx (100%) rename src/content/docs/browser-rendering/{quick-actions-rest-api => rest-api}/screenshot-endpoint.mdx (100%) rename src/content/docs/browser-rendering/{quick-actions-rest-api => rest-api}/snapshot.mdx (100%) diff --git a/public/_redirects b/public/_redirects index 619e0c05a31b11b..92b29a15814b8c1 100644 --- a/public/_redirects +++ b/public/_redirects @@ -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 @@ -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 @@ -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 diff --git a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx index a12587b9d0c7b98..76f6070ec63564f 100644 --- a/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx +++ b/src/content/changelog/browser-rendering/2025-02-27-br-rest-api-beta.mdx @@ -9,10 +9,11 @@ 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. + +- **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 + **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: @@ -31,4 +32,4 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts//browser- --output "screenshot.webp" ``` -Learn more in our [documentation](/browser-rendering/quick-actions-rest-api/). +Learn more in our [documentation](/browser-rendering/rest-api/). diff --git a/src/content/docs/browser-rendering/get-started.mdx b/src/content/docs/browser-rendering/get-started.mdx index 5abf934d66a51b3..d75c19a3ac10af5 100644 --- a/src/content/docs/browser-rendering/get-started.mdx +++ b/src/content/docs/browser-rendering/get-started.mdx @@ -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. diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/index.mdx b/src/content/docs/browser-rendering/quick-actions-rest-api/index.mdx deleted file mode 100644 index fb9435a6bfb51b0..000000000000000 --- a/src/content/docs/browser-rendering/quick-actions-rest-api/index.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -pcx_content_type: navigation -title: Quick Actions REST API -sidebar: - order: 2 - group: - badge: Beta ---- - -The Quick Actions 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"; - - - -Use the Quick Actions 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` diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/content-endpoint.mdx b/src/content/docs/browser-rendering/rest-api/content-endpoint.mdx similarity index 100% rename from src/content/docs/browser-rendering/quick-actions-rest-api/content-endpoint.mdx rename to src/content/docs/browser-rendering/rest-api/content-endpoint.mdx diff --git a/src/content/docs/browser-rendering/rest-api/index.mdx b/src/content/docs/browser-rendering/rest-api/index.mdx new file mode 100644 index 000000000000000..656be53ba352c44 --- /dev/null +++ b/src/content/docs/browser-rendering/rest-api/index.mdx @@ -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"; + + + +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` diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/pdf-endpoint.mdx b/src/content/docs/browser-rendering/rest-api/pdf-endpoint.mdx similarity index 100% rename from src/content/docs/browser-rendering/quick-actions-rest-api/pdf-endpoint.mdx rename to src/content/docs/browser-rendering/rest-api/pdf-endpoint.mdx diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/scrape-endpoint.mdx b/src/content/docs/browser-rendering/rest-api/scrape-endpoint.mdx similarity index 100% rename from src/content/docs/browser-rendering/quick-actions-rest-api/scrape-endpoint.mdx rename to src/content/docs/browser-rendering/rest-api/scrape-endpoint.mdx diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/screenshot-endpoint.mdx b/src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx similarity index 100% rename from src/content/docs/browser-rendering/quick-actions-rest-api/screenshot-endpoint.mdx rename to src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx diff --git a/src/content/docs/browser-rendering/quick-actions-rest-api/snapshot.mdx b/src/content/docs/browser-rendering/rest-api/snapshot.mdx similarity index 100% rename from src/content/docs/browser-rendering/quick-actions-rest-api/snapshot.mdx rename to src/content/docs/browser-rendering/rest-api/snapshot.mdx diff --git a/src/content/docs/browser-rendering/workers-binding-api/index.mdx b/src/content/docs/browser-rendering/workers-binding-api/index.mdx index dbfac2ebb499ad5..e90b1edc3feb371 100644 --- a/src/content/docs/browser-rendering/workers-binding-api/index.mdx +++ b/src/content/docs/browser-rendering/workers-binding-api/index.mdx @@ -11,4 +11,4 @@ The Workers Binding API allows you to execute advanced browser rendering scripts -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.