You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,10 @@ The `/screenshot` endpoint renders the webpage by processing its HTML and JavaSc
17
17
18
18
Sets the HTML content of the page to `Hello World!` and then takes a screenshot. The option `omitBackground` hides the default white background and allows capturing screenshots with transparency.
19
19
20
-
```bash
21
-
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' \
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' \
51
+
-H 'Authorization: Bearer <apiToken>' \
52
+
-H 'Content-Type: application/json' \
53
+
-d '{
54
+
"url": "https://www.cloudflare.com"
55
+
}' \
56
+
--output "screenshot.png"
57
+
```
58
+
55
59
For more options to control the final screenshot, like `clip`, `captureBeyondViewport`, `fullPage` and others, check the endpoint [reference](/api/resources/browser_rendering/subresources/screenshot/methods/create/).
56
60
57
61
:::note[Notes for basic usage]
@@ -83,7 +87,6 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
83
87
--output "authenticated-screenshot.png"
84
88
```
85
89
86
-
87
90
### Navigate and capture a full-page screenshot
88
91
89
92
Navigate to `https://cloudflare.com/`, changing the page size (`viewport`) and waiting until there are no active network connections (`waitUntil`) or up to a maximum of `4500ms` (`timeout`). Then take a `fullPage` screenshot.
0 commit comments