Quick Actions provide simple interfaces for common browser tasks like capturing screenshots, extracting HTML content, generating PDFs, and more. You can use Quick Actions in two ways:
- REST API: HTTP endpoints for one-off requests or external integration.
- Workers Bindings: Call Quick Actions directly from a Cloudflare Worker using
env.BROWSER.quickAction().
The following are the available options:
- /content - Fetch HTML
- /screenshot - Capture screenshot
- /pdf - Render PDF
- /markdown - Extract Markdown from a webpage
- /snapshot - Capture multiple page formats
- /accessibilityTree - Capture accessibility tree
- /scrape - Scrape HTML elements
- /json - Capture structured data using AI
- /links - Retrieve links from a webpage
- /crawl - Crawl web content
- Reference
/crawl is available via the REST API only.
Use Quick Actions when you need a fast, simple way to perform common browser tasks such as capturing screenshots, extracting HTML, or generating PDFs without writing complex scripts. For more advanced automation, custom workflows, or persistent browser sessions, use Puppeteer, Playwright, or CDP.
To use Quick Actions via the REST API, create a custom API Token with the following permissions:
Browser Run - Edit
To use Quick Actions from a Worker, configure a browser binding in your wrangler.json. No API token is needed when using the Workers binding.
{
"browser": {
"binding": "BROWSER"
}
}Under npx wrangler dev, .quickAction() uses a Chrome instance on your machine. It returns the same responses and errors as Browser Run, with two exceptions:
- The
jsonaction returns placeholder data, because Workers AI is not available locally. If a field inresponse_format.json_schemasetsconst,enum, ordefault, it gets that value, or the firstenumentry. Other fields get an empty value, such as"",0,false, or[]. Wrangler also logs a warning. - The Kitesurf browser is not available. If you pass
browser: "kitesurf",.quickAction()throws an error.
To get real json results or use Kitesurf during local development, set "remote": true in your browser binding configuration:
{
"browser": {
"binding": "BROWSER",
"remote": true
}
}