Cloudflare
Cloudflare
Browser Run: a route per output, crawl jobs, links and the accessibility tree.
- Supports
- 11 of 14 operations
- Scrape
- one call
- Needs
- cf auth login or CLOUDFLARE_API_TOKEN
- Endpoint
- api.cloudflare.com
Operations
- scrapeone call
- screenshotone call
- elementone call
- pdfone call
- crawlone call
- linksone call
- a11y treeone call
- webmcpone call
- extractone call
- searchno
- sessionsone call
- cdpone call
- navigateno
- evaluateno
Recorded
- Came back
- markdown
- Size
- 991 characters
- Time
- 3,065 ms
This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.
Access
- Create
create("cloudflare") - CLI
browsers scrape https://example.com -p cloudflare - Tool
provider: "cloudflare"
Cloudflare's Browser Run has a REST route for nearly everything: /markdown, /content, /screenshot, /pdf, /links, /json for extract, /accessibilityTree, and /crawl for jobs. No session needed for any of them. The operations band above adds them up.
Already ran cf auth login? Cloudflare can use that session, so there's no token to export. The provider gets credentials through @agntn/credentials. It checks for a token in this order: config apiKey, CLOUDFLARE_API_TOKEN, then the cf session. For the account, it checks config accountID, AGNTN_CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_ACCOUNT_ID, then the session if it reaches exactly one account. An exported CLOUDFLARE_API_TOKEN still needs an account variable. The session doesn't lend it one.
The old CF_API_TOKEN and CF_ACCOUNT_ID dance is over. Neither name is read anymore, so this is a breaking change. A cf token expires, so the provider looks credentials up per request. A 401 with a cf token gets one retry with a fresh token from cf. A config or env token fails right away, because asking again returns the same one.
Ask for more than one output and it renders once: formats: ["markdown", "html"], screenshot: true or links: true go through /snapshot and come back together. With links: true the unique hrefs land in page.links. That's a tidy way to keep text and destinations together. A scrape also fills title and statusCode.
The markdown starts with a front matter block. It puts title: "Example Domain" between --- lines, followed by the page text.
browser: "kitesurf" switches to Cloudflare's Kitesurf engine. Without it you're on Chromium. Just don't ask it for a session. Cloudflare ties each Kitesurf browser to its CDP socket, and its session route used to start Chromium without a word. Now createSession() throws InvalidInputError before any request. Scrape, crawl, WebMCP and the rest still take Kitesurf.
Kitesurf's /snapshot answers every body with HTTP 422, even a bare { url }, so scrapes with several outputs used to just fail. Now each output goes to its own route at once, /markdown, /content, /screenshot or /links, and comes back merged. The single render takes a break here. Each output costs a render, but at least the scrape works.
WebMCP is the one thing here without a REST route. No route returns what a page's script returns. So each call gets a browser of its own, Kitesurf too. It closes when the call ends.