# AI agents can read the whole page structure! Browser Run adds a dedicated accessibility tree endpoint!

Hi everyone, it's me! Today I've got an update that will make anyone letting AI agents drive web pages smile. It's a new endpoint that lets you receive a page's "structure" instead of its "looks"!

## What was announced?

The Cloudflare Changelog announced that Browser Run now supports a standalone `/accessibilityTree` endpoint.

With it, you can request just the accessibility tree of a rendered web page directly. An accessibility tree is the browser's structured view of a page: the role, name, state, value, and hierarchy of its elements.

As the name suggests, this information was originally meant for accessibility tooling. But Cloudflare is highlighting how useful it also is for AI agents and automation workflows.

## The story so far

Up to now, getting an AI agent to understand a page mostly meant one of two things: taking a screenshot and inferring from the pixels, or handing over the raw HTML and parsing it.

Both are heavy, though. Screenshots cost more, and raw HTML is noisy, so it is hard for an agent to work out "what is where" right now.

That is exactly where an accessibility tree, which cleanly exposes only the semantic structure, comes in!

## What changes

The biggest win is for people building AI agents. Because you can pass the page structure directly, you cut down on both pixel inference and HTML parsing.

Agents can more naturally judge "what elements exist" and "which actions are available" from the structure. Buttons, links, and headings line up by their role and name, so it is easier to decide the next move.

Of course it still works for building the accessibility tooling it was originally for, and it fits automation workflows that just need the page structure too.

## Dive Deep

The request is really simple. You just POST a URL to your account's Browser Run endpoint.

```
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/{accountId}/browser-run/accessibilityTree' \
  -H 'Authorization: Bearer {apiToken}' \
  -H 'Content-Type: application/json' \
  -d '{ "url": "https://example.com/" }'
```

What comes back is a tree structure with role, name, and children. Here's an example.

```
{
  "success": true,
  "result": {
    "accessibilityTree": {
      "role": "RootWebArea",
      "name": "Example Domain",
      "children": [
        { "role": "heading", "name": "Example Domain", "level": 1 },
        { "role": "link", "name": "Learn more" }
      ]
    }
  }
}
```

There are some tuning parameters too.

- `interestingOnly` — returns only semantically meaningful nodes to keep the tree tidy
- `root` — targets a specific subtree instead of the whole page

And here's the key: use the new `/accessibilityTree` when you only need a page's structure, and use `/snapshot` when you want multiple formats in a single API call. The `/snapshot` endpoint also returns Markdown, HTML, and screenshots together.

## Wrap-up

- Cloudflare's Browser Run added the `/accessibilityTree` endpoint
- It returns the accessibility tree (role, name, state, value, hierarchy) of a rendered page directly
- You can hand page structure to AI agents with no screenshots or raw HTML
- `interestingOnly` narrows to meaningful nodes; `root` narrows to a subtree
- Use `/snapshot` when you want several formats at once

This one quietly pays off for developers driving browsers with AI agents or automation!
