diff --git a/src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx b/src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx index d73a7cc51c4b09..50c7be03a708f7 100644 --- a/src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx +++ b/src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx @@ -52,6 +52,13 @@ console.log(screenshot.status); +### Capture a screenshot from a URL + + + 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/). :::note[Notes for basic usage] diff --git a/src/content/partials/browser-rendering/example-screenshot-from-url.mdx b/src/content/partials/browser-rendering/example-screenshot-from-url.mdx new file mode 100644 index 00000000000000..7e897a75ce3993 --- /dev/null +++ b/src/content/partials/browser-rendering/example-screenshot-from-url.mdx @@ -0,0 +1,12 @@ +```bash +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": { + "omitBackground": true + } + }' \ + --output "screenshot.png" +```