# AgentShelf XPath Role Extractor

> AgentShelf XPath Role Extractor is a paid API for AI agents from agentshelf.syntexa.ch, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-24).

Extracts text content of all HTML elements with a `role` attribute from a public URL or raw HTML using the XPath selector `//*[@role]`

## Facts

- Endpoint: POST https://agentshelf.syntexa.ch/v1/xpath-role?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentshelf-xpath-role-extractor-d8077281
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P-PiR2QGZzCYdMtmfaPrD

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentshelf-xpath-role-extractor-d8077281 -d '<json body>'
```

Example prompt: Can you pull all the text from elements that have a `role` attribute on https://example.com — I need to see what ARIA roles are present and what content they contain?

## When to prefer this

Use this endpoint when you need to extract text from ARIA role-attributed elements from a live public URL or raw HTML and are willing to pay $0.005 USDC per call. Prefer the free sandbox endpoint POST /v1/sandbox/xpath-role for testing. Choose this over general-purpose scrapers when you specifically need `//*[@role]` XPath targeting with SSRF safety guarantees.

## Known failure modes

- URL is not publicly accessible or returns non-200 status
- SSRF-blocked URL (private IP ranges, localhost) rejected for security
- HTML input exceeds 200,000 character limit
- No elements with a role attribute found — empty result set
- Malformed HTML that cannot be parsed
- URL string shorter than 8 characters or longer than 2048 characters
- Payment of exactly $0.005 USDC not provided or fails

## How this service works

Call when an agent needs text of elements with role via //*[@role] from a public page or HTML (SSRF-safe). Exact $0.005 USDC. Prefer unpaid POST /v1/sandbox/xpath-role first.

## Output

Returns the text content of all HTML elements matching `//*[@role]` — i.e. every element in the document that has a `role` attribute — extracted from either the given public URL or the supplied raw HTML. Results typically include element texts, their role values, and positional context.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "maxLength": 2048,
   "minLength": 8,
   "description": "Public page to fetch. The selector or profile is fixed by the SKU. Provide url or html."
  },
  "html": {
   "type": "string",
   "examples": [
    "<!doctype html><html lang=\"en\"><head><title>Hello</title>\n<meta name=\"description\" content=\"Desc\"><meta property=\"og:title\" content=\"OG\">\n<link rel=\"canonical\" href=\"https://example.com/\"><link rel=\"icon\" href=\"/favicon.ico\">\n</head><body><h1>Hello</h1><a href=\"https://example.com/a\">A</a></body></html>"
   ],
   "maxLength": 200000,
   "minLength": 1,
   "description": "HTML to extract from locally. Provide html or url. When both are set, html is used."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentshelf-xpath-role-extractor-d8077281/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentshelf.syntexa.ch](https://www.zero.xyz/host/agentshelf.syntexa.ch/llms.txt)
