# AgentShelf XPath Data Extraction

> AgentShelf XPath Data Extraction is a paid API for AI agents from agentshelf.syntexa.ch, paid per call via x402, $0.009/call, status unknown (last checked 2026-09-29).

Evaluates XPath expressions against a public URL or raw HTML to extract text content, with SSRF protection on URL fetching.

## Facts

- Endpoint: POST https://agentshelf.syntexa.ch/v1/xpath-dd?utm_source=zero.xyz
- Price: $0.009/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentshelf-xpath-data-extraction-7b0e99b4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pleKO_19ipCc7cGfdzrGc

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-data-extraction-7b0e99b4 -d '<json body>'
```

Example prompt: Can you extract the article headline from https://example.com/news/article using the XPath expression //h1[@class='headline']?

## When to prefer this

Choose this endpoint when you need to extract a specific piece of text or data from a webpage or HTML document using a precise XPath selector, especially when you already know the document structure. It is preferable over full-page scraping when only a targeted node is needed. If you have raw HTML locally, pass it directly; if you need the page fetched, pass the URL and rely on its SSRF-safe fetching. Use the free sandbox variant /v1/sandbox/xpath-dd first for development.

## Known failure modes

- Invalid or malformed XPath expression returns a parsing error
- URL points to a private/internal IP address and is rejected by SSRF protection
- URL is unreachable or returns a non-200 status, causing a fetch failure
- HTML content exceeds 200,000 character limit, resulting in rejection
- XPath matches no nodes, returning an empty result
- Malformed HTML may cause unpredictable XPath evaluation results

## How this service works

Call when an agent needs text of //dd via //dd from a public page or HTML (SSRF-safe). Exact $0.009 USDC. Prefer unpaid POST /v1/sandbox/xpath-dd first.

## Output

Returns the text content matched by the XPath expression, either fetched from the given public URL (SSRF-safe) or evaluated against the provided raw HTML. The response contains the extracted text nodes or attribute values selected by the XPath query.

## 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-data-extraction-7b0e99b4/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)
