All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Browser Run - New formats parameter for the Browser Run /snapshot endpoint

23d ago

Source

CloudflareBrowser Run - New formats parameter for the Browser Run /snapshot endpointcloudflare.com
Snippet from the RSS feed
Browser Run '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 a token-efficient representation of page content that LLMs can process directly, without parsing HTML markup. The accessibility tree provides a structured representation of a page's elements, including roles, labels, and hierarchy, helping LLMs understand page structure and navigate its contents. The following example returns a screenshot, Markdown, and the accessibility tree in one call: curl curl -X POST ' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "url": " "formats": ["screenshot", "markdown", "accessibilityTree"] }' TypeScript SDK import Cloudflare from "cloudflare" ; const client = new Cloudflare ( { apiToken : process . env [ "CLOUDFLARE_API_TOKEN" ] , } ) ; const snapshot = await client . browserRendering . snapshot . create ( { account_id : process . env [ "CLOUDFLARE_ACCOUNT_ID" ] , url : " , formats : [ "screenshot" , "markdown" , "accessibilityTree" ] , } ) ; console . log ( snapshot . markdown ) ; console . log ( snapshot . accessibilityTree ) ; Workers Bindings interface Env { BROWSER : BrowserRun ; } export default { async fetch ( request , env ) : Promise < Response > { return await env . BROWSER . quickAction ( "snapshot" , { url : " , formats : [ "screenshot" , "markdown" , "accessibilityTree" ] , } ) ; }, } satisfies ExportedHandler < Env >; You must request at least two formats. If you only need one, use the respective single-format endpoint such as /screenshot or /markdown . Refer to the /snapshot documentation for the full list of accepted values.

You might also wanna read

Office Open XML Viewer: AI-generated browser-based document renderer using Rust/WASM and Canvas 2D

A browser-based viewer for Office Open XML documents (DOCX, XLSX, PPTX) that renders to an HTML Canvas element. The parsers are written in R

github.com·27d ago

Using Markdown as a Protocol for AI-Generated User Interfaces

The article explores the concept of using Markdown as a protocol for agentic AI interfaces, where AI assistants can generate reactive user i

fabian-kuebler.com·3mo ago

Copy as Markdown: Tool Converts Web Content to Markdown Format for AI Language Models

The article introduces 'Copy as Markdown,' a tool that converts web content into clean Markdown format specifically optimized for use with L

Product Hunt·1y ago

Browser Rendering Launches /crawl Endpoint for Automated Website Crawling

Browser Rendering has launched a new /crawl endpoint in open beta that allows developers to crawl entire websites with a single API call. Th

developers.cloudflare.com·3mo ago

Browser Rendering Launches /crawl Endpoint for Automated Website Crawling

Browser Rendering has launched a new /crawl endpoint in open beta that allows developers to crawl entire websites with a single API call. Th

Cloudflare·3mo ago

Text-Based Web Browsers: Their Continued Relevance for Accessibility Testing and Semantic HTML

The article discusses the relevance of text-based web browsers in modern web development, emphasizing their importance for testing website a

cssence.com·5mo ago

Porting JustHTML HTML5 Parser from Python to JavaScript Using Codex CLI and GPT-5.2

The author describes successfully porting JustHTML, a standards-compliant HTML5 parser originally written in Python, to JavaScript using Cod

simonwillison.net·6mo ago

Comments

Sign in to join the conversation.

No comments yet. Be the first.