Skip to content

Update snapshot docs#31298

Open
blackmountainb wants to merge 5 commits into
cloudflare:productionfrom
blackmountainb:blackmountainb/snapshot-formats
Open

Update snapshot docs#31298
blackmountainb wants to merge 5 commits into
cloudflare:productionfrom
blackmountainb:blackmountainb/snapshot-formats

Conversation

@blackmountainb
Copy link
Copy Markdown

Summary

Documents the new formats parameter on the Browser Run /snapshot endpoint, which lets users control which representations of a page are returned in a single request.

Changes:

  • src/content/docs/browser-rendering/rest-api/snapshot/index.mdx
  • Updated the opening paragraph to reflect that /snapshot can now return up to four representations (HTML content, screenshot, Markdown, accessibility tree), not just HTML + screenshot.
  • Added a new "Choose which outputs to return" section under Advanced usage, explaining the formats parameter, the accepted values (content, screenshot, markdown, accessibilityTree), the default (["content", "screenshot"]), and the constraint that at least two formats must be requested (single-format requests should use the dedicated endpoints).
  • Includes a curl example combining screenshot, markdown, and accessibilityTree, plus a sample JSON response.
  • Changelog entry announcing the new formats parameter, linking to the updated /snapshot docs.

Documentation checklist

blackmountainb and others added 3 commits June 8, 2026 11:05
The `/snapshot` endpoint now supports optional formats for response, including Markdown and accessibility tree. Updated documentation to reflect these changes and added usage examples.
@cloudflare-docs-bot
Copy link
Copy Markdown
Contributor

cloudflare-docs-bot Bot commented Jun 8, 2026

Review

⏸️ Automatic reviews for this PR are paused.

This PR has already received 2 automatic reviews. To run another review, a codeowner can comment /review or /full-review.

Tip: Keep PRs in draft mode until they are ready for review — the bot skips draft PRs automatically.


⚠️ 2 warnings found in commit 883370b.

Warnings (2)
File Issue
browser-run/quick-actions/snapshot.mdx line 162 Escape angle brackets in MDX prose — Line adds unescaped < in prose: curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/snapshot' \ Fix: Replace < with &lt; or wrap the text in backticks.
browser-run/quick-actions/snapshot.mdx line 163 Escape angle brackets in MDX prose — Line adds unescaped < in prose: -H 'Authorization: Bearer <apiToken>' \ Fix: Replace < with &lt; or wrap the text in backticks.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

@blackmountainb blackmountainb changed the title Blackmountainb/snapshot formats Update snapshot docs Jun 8, 2026
{
"success": true,
"result": {
"screenshot": "AdvancedBase64Screenshot",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why advanced? would just place an example base64 string or just say base64screenshot

Copy link
Copy Markdown
Author

@blackmountainb blackmountainb Jun 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in convention to the previous example of ### Create a snapshot from custom HTML

"result": {
"screenshot": "AdvancedBase64Screenshot",

But maybe both should be changed to match the basic example, with Base64EncodedScreenshotString

"screenshot": "Base64EncodedScreenshotString",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants