File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
src/content/docs/browser-rendering/quick-actions-rest-api Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,14 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
1414 -H ' Authorization: Bearer <apiToken>' \
1515 -H ' Content-Type: application/json' \
1616 -d ' {
17- "url": "https://example.com/",
18- "elements": {
19- "selectors": ["h1", ".article"]
20- }
21- }'
17+ "url": "https://example.com/",
18+ "elements": [{
19+ "selector": "h1"
20+ },
21+ {
22+ "selector": "a"
23+ }]
24+ }
2225```
2326
2427### JSON response
Original file line number Diff line number Diff line change @@ -32,9 +32,7 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
3232 -d ' {
3333 "url": "https://cloudflare.com/",
3434 "screenshotOptions": {
35- "type": "webp",
3635 "omitBackground": true,
37- "quality": 80
3836 },
3937 "viewport": {
4038 "width": 1280,
@@ -77,9 +75,7 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
7775- ` url ` _ (string)_ - The webpage URL to take a screenshot of.
7876- ` html ` _ (string)_ - Instead of a URL, allows rendering custom HTML for the screenshot.
7977- ` screenshotOptions ` _ (object)_ - Configures the screenshot format and quality.
80- - ` type ` _ (string)_ - Defines the image format (` jpeg ` , ` png ` , ` webp ` ).
8178 - ` omitBackground ` _ (boolean)_ - Removes the default white background when taking a screenshot.
82- - ` quality ` _ (number)_ - (For JPEG/WebP) Compression quality from 0 to 100\.
8379- ` viewport ` _ (object)_ - Sets the browser viewport dimensions for rendering.
8480 - ` width ` _ (number)_ - Viewport width in pixels.
8581 - ` height ` _ (number)_ - Viewport height in pixels.
You can’t perform that action at this time.
0 commit comments