Skip to content

Commit 5e992df

Browse files
kathaylToriLindsay
andauthored
Create example-screenshot-from-url.mdx (#25109)
* Create example-screenshot-from-url.mdx make new example a partial so can be used in get started page AND screenshot endpoint page example = screenshot from url * Update screenshot-endpoint.mdx * Update src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx Co-authored-by: ToriLindsay <[email protected]> --------- Co-authored-by: ToriLindsay <[email protected]>
1 parent a40b924 commit 5e992df

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ console.log(screenshot.status);
5252

5353
</TabItem> </Tabs>
5454

55+
### Capture a screenshot from a URL
56+
57+
<Render
58+
file="example-screenshot-from-url"
59+
product="browser-rendering"
60+
/>
61+
5562
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/).
5663

5764
:::note[Notes for basic usage]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```bash
2+
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/screenshot' \
3+
-H 'Authorization: Bearer <apiToken>' \
4+
-H 'Content-Type: application/json' \
5+
-d '{
6+
"html": "Hello World!",
7+
"screenshotOptions": {
8+
"omitBackground": true
9+
}
10+
}' \
11+
--output "screenshot.png"
12+
```

0 commit comments

Comments
 (0)