---
title: "Read one element's DOM facts"
method: POST
path: "/v1/browser/element"
tags: ["Browser"]
---

# Read one element's DOM facts

`POST /v1/browser/element`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/browser/element`
- Auth: HTTP bearer

The browser_element_get tool's mirror. Names the element one way (backendNodeId, uid, selector, or x and y) and answers its tag, id, classes, attributes, accessible role and name, box, visibility, text excerpt, child count, parent summary and framework owner. Read-only.

## Request body

- object
  - `backendNodeId` integer: A browser_snapshot node's backendDOMNodeId (preferred)
  - `uid` string: A browser_snapshot node's id
  - `selector` string: A Piper selector matching one element (role:, label:, testid:, text:, css:)
  - `x` number: Viewport x coordinate, with y
  - `y` number: Viewport y coordinate, with x
  - `html` boolean: Include the element's outer HTML, up to 4,000 characters

## Response `200`

The element

- object
  - `backendNodeId` integer, required
  - `tagName` string, required
  - `classes` string[], required
  - `attributes` object[], required
  - `visible` boolean, required
  - `inViewport` boolean, required
  - `childElementCount` integer, required
  - `truncated` boolean, required

## Other responses

- `400`: The element was not named exactly one way, or could not be read
- `409`: The route needs a live page session. Two types share this status and both clear the same way, by connecting: `not_connected` when nothing is attached at all, and `page_not_attached` when the browser is alive but its page session is not — Chrome closed the tab or detached the inspector, which parks the connection at browser level rather than tearing it down. Both carry `remedy` (`browser_connect action:connect`) and `remedyPath` (`POST /v1/browser/connect`). Branch on `error.type`, never on the 409 alone; the other 409s on browser routes (`conflict`, `dialog_pending`, `browser_consent_required`, `target_leased`, `instance_unknown`, `resource_admission_full`) must not be retried, and one of them mints a second OS consent prompt per attempt.

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
