{"id":550,"date":"2026-06-11T00:00:00","date_gmt":"2026-06-11T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/06\/11\/browser-run-new-formats-parameter-for-the-browser-run-snapshot-endpoint\/"},"modified":"2026-06-11T00:00:00","modified_gmt":"2026-06-11T00:00:00","slug":"browser-run-new-formats-parameter-for-the-browser-run-snapshot-endpoint","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/06\/11\/browser-run-new-formats-parameter-for-the-browser-run-snapshot-endpoint\/","title":{"rendered":"Browser Run &#8211; New formats parameter for the Browser Run \/snapshot endpoint"},"content":{"rendered":"<p><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/\">Browser Run<\/a>&#8216;s <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/snapshot\/\"><code>\/snapshot<\/code> endpoint<\/a> now supports a <code>formats<\/code> parameter that lets you return multiple page formats in a single API call. Previously, <code>\/snapshot<\/code> returned only HTML content and a screenshot. You can now also include Markdown and the accessibility tree in the same response.<\/p>\n<p>These formats are particularly useful for AI agent workflows:<\/p>\n<ul>\n<li>Markdown provides a token-efficient representation of page content that LLMs can process directly, without parsing HTML markup.<\/li>\n<li>The accessibility tree provides a structured representation of a page&#8217;s elements, including roles, labels, and hierarchy, helping LLMs understand page structure and navigate its contents.<\/li>\n<\/ul>\n<p>The following example returns a screenshot, Markdown, and the accessibility tree in one call:<\/p>\n<ul>\n<li>\n<p>curl<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"bash\"><code class=\"language-bash\"><div><div><span>curl<\/span><span> <\/span><span>-X<\/span><span> <\/span><span>POST<\/span><span> <\/span><span>'https:\/\/api.cloudflare.com\/client\/v4\/accounts\/&lt;accountId&gt;\/browser-rendering\/snapshot'<\/span><span> <\/span><span><\/span><\/div><\/div><div><div><span>  <\/span><span>-H<\/span><span> <\/span><span>'Authorization: Bearer &lt;apiToken&gt;'<\/span><span> <\/span><span><\/span><\/div><\/div><div><div><span>  <\/span><span>-H<\/span><span> <\/span><span>'Content-Type: application\/json'<\/span><span> <\/span><span><\/span><\/div><\/div><div><div><span>  <\/span><span>-d<\/span><span> <\/span><span>'{<\/span><\/div><\/div><div><div><span><span>    <\/span><\/span><span>\"url\": \"https:\/\/example.com\/\",<\/span><\/div><\/div><div><div><span><span>    <\/span><\/span><span>\"formats\": [\"screenshot\", \"markdown\", \"accessibilityTree\"]<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>}'<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<li>\n<p>TypeScript SDK<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"typescript\"><code class=\"language-typescript\"><div><div><span><span>import <\/span><span>Cloudflare<\/span><span> from <\/span><\/span><span>\"cloudflare\"<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>const<\/span><span> <\/span><span>client<\/span><span> <\/span><span>=<\/span><span> <\/span><span>new<\/span><span> <\/span><span>Cloudflare<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>apiToken<\/span><span>:<\/span><span> <\/span><span>process<\/span><span>.<\/span><span>env<\/span><span>[<\/span><span>\"CLOUDFLARE_API_TOKEN\"<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>const<\/span><span> <\/span><span>snapshot<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>client<\/span><span>.<\/span><span>browserRendering<\/span><span>.<\/span><span>snapshot<\/span><span>.<\/span><span>create<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>account_id<\/span><span>:<\/span><span> <\/span><span>process<\/span><span>.<\/span><span>env<\/span><span>[<\/span><span>\"CLOUDFLARE_ACCOUNT_ID\"<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>url<\/span><span>:<\/span><span> <\/span><span>\"https:\/\/example.com\/\"<\/span><span>,<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>formats<\/span><span>:<\/span><span> [<\/span><span>\"screenshot\"<\/span><span>,<\/span><span> <\/span><span>\"markdown\"<\/span><span>,<\/span><span> <\/span><span>\"accessibilityTree\"<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>console<\/span><span>.<\/span><span>log<\/span><span>(<\/span><span>snapshot<\/span><span>.<\/span><span>markdown<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div><span>console<\/span><span>.<\/span><span>log<\/span><span>(<\/span><span>snapshot<\/span><span>.<\/span><span>accessibilityTree<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<div><\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<li>\n<p>Workers Bindings<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"typescript\"><code class=\"language-typescript\"><div><div><span>interface<\/span><span> <\/span><span>Env<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>BROWSER<\/span><span>:<\/span><span> <\/span><span>BrowserRun<\/span><span>;<\/span><\/div><\/div><div><div><span>}<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>export<\/span><span> <\/span><span>default<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span>  <\/span><span>async<\/span><span> <\/span><span>fetch<\/span><span>(<\/span><span>request<\/span><span>,<\/span><span> <\/span><span>env<\/span><span>)<\/span><span>:<\/span><span> <\/span><span>Promise<\/span><span>&lt;<\/span><span>Response<\/span><span>&gt;<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span>    <\/span><span>return<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>BROWSER<\/span><span>.<\/span><span>quickAction<\/span><span>(<\/span><span>\"snapshot\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>      <\/span><\/span><span>url<\/span><span>:<\/span><span> <\/span><span>\"https:\/\/example.com\/\"<\/span><span>,<\/span><\/div><\/div><div><div><span><span>      <\/span><\/span><span>formats<\/span><span>:<\/span><span> [<\/span><span>\"screenshot\"<\/span><span>,<\/span><span> <\/span><span>\"markdown\"<\/span><span>,<\/span><span> <\/span><span>\"accessibilityTree\"<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>    <\/span><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div><span>  <\/span><span>},<\/span><\/div><\/div><div><div><span>}<\/span><span> <\/span><span>satisfies<\/span><span> <\/span><span>ExportedHandler<\/span><span>&lt;<\/span><span>Env<\/span><span>&gt;;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<div><\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<\/ul>\n<p>You must request at least two formats. If you only need one, use the respective single-format endpoint such as <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/screenshot-endpoint\/\"><code>\/screenshot<\/code><\/a> or <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/markdown-endpoint\/\"><code>\/markdown<\/code><\/a>.<\/p>\n<p>Refer to the <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/snapshot\/\"><code>\/snapshot<\/code> documentation<\/a> for the full list of accepted values.<\/p>","protected":false},"excerpt":{"rendered":"<p>Browser Run&#8216;s \/snapshot endpoint now supports a formats parameter that lets you return multiple page formats in a single API call. Previously, \/snapshot returned only HTML content and a screenshot. You can now also include Markdown and the accessibility tree in the same response. These formats are particularly useful for AI agent workflows: Markdown provides [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}