AbstractDevTools JSON methods exposed through one nested binding target.
Acquire a new browser session and return its metadata.
Optionaloptions: BrowserRunAcquireOptionsReturn a session-pinned WebSocket capability for an existing session.
Optionaloptions: BrowserRunConnectOptionsSend a raw HTTP request to the Browser Run API.
Used by libraries like @cloudflare/puppeteer to acquire and connect to a browser instance.
Optionalinit: RequestInit<CfProperties<unknown>>Mint an authenticated live-view link for a browser session.
Optionaloptions: BrowserRunLiveViewOptionsReturn details for one browser session, or null when it does not exist.
List recent active and closed browser sessions.
Optionaloptions: BrowserRunHistoryOptionsAcquire a browser session and return a session-pinned WebSocket capability.
Optionaloptions: BrowserRunAcquireOptionsReturn the caller's browser-session and browser-time limits.
List the caller's active browser sessions.
Optionaloptions: BrowserRunListSessionsOptionsTake a screenshot of a web page.
Must be 'screenshot'.
Screenshot options including viewport, selectors, and image format.
A Response containing one of:
Success (HTTP 200):
Content-Type: image/png, image/jpeg, or image/webp (when encoding: 'binary', the default)Content-Type: text/plain (when encoding: 'base64')Error:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Generate a PDF of a web page.
Must be 'pdf'.
PDF generation options including page size, margins, and headers/footers.
A Response containing one of:
Success (HTTP 200):
Content-Type: application/pdfError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Get the HTML content of a web page.
Must be 'content'.
Navigation and page interaction options.
A Response containing one of:
Success (HTTP 200):
BrowserRunContentSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Scrape elements from a web page by CSS selector.
Must be 'scrape'.
Scrape options with CSS selectors for elements to extract.
A Response containing one of:
Success (HTTP 200):
BrowserRunScrapeSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Extract all links from a web page.
Must be 'links'.
Options to filter visible or internal links only.
A Response containing one of:
Success (HTTP 200):
BrowserRunLinksSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Get several representations of a web page in one request.
Must be 'snapshot'.
Snapshot options including the formats to return and
screenshot settings (encoding is always base64).
A Response containing one of:
Success (HTTP 200):
BrowserRunSnapshotSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Extract structured JSON data from a web page using AI.
Must be 'json'.
JSON extraction options with prompt or response_format schema.
A Response containing one of:
Success (HTTP 200):
BrowserRunJsonSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)2012 for HTML-to-markdown conversion failuresrawAiResponse field)Headers:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Convert a web page to Markdown.
Must be 'markdown'.
Navigation and page interaction options.
A Response containing one of:
Success (HTTP 200):
BrowserRunMarkdownSuccessResponse JSON with Content-Type: application/jsonError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)2012 for HTML-to-markdown conversion failuresHeaders:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)Get the accessibility tree of a web page.
Must be 'accessibilityTree'.
Options to scope the tree to a subtree and to control whether semantically uninteresting nodes are pruned.
A Response containing one of:
Success (HTTP 200):
BrowserRunAccessibilityTreeSuccessResponse JSON with Content-Type: application/jsonresult.accessibilityTree is null when root matched no elementError:
BrowserRunErrorResponse JSON with appropriate HTTP status code (400, 422, 429, 500, 503)root selector2017 or 2018 when the tree could not be builtHeaders:
X-Browser-Ms-Used: Browser time consumed in milliseconds (set when status < 500)
Browser Run API binding for automating headless browsers.
See
https://developers.cloudflare.com/browser-run/