# Code Snippets — Attribute Extraction

> Code Snippets — Attribute Extraction is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-21).

Extracts the value of a specified HTML attribute from code snippet elements on a given webpage or HTML document.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/assistant-bx-web-code-attributes?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-snippets-attribute-extraction-f02429d4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TjEZA9hkVg2sBy6xDzb6w

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 code-snippets-attribute-extraction-f02429d4 -d '<json body>'
```

Example prompt: From this HTML page at https://docs.example.com/snippets, find the code element containing the term 'authentication' and extract the value of its data-kind attribute.

## When to prefer this

Use this endpoint when you need to extract a specific HTML attribute from a code snippet element on a static webpage or a known HTML document, especially when the attribute name and a keyword to identify the relevant code block are known. It is best suited for documentation pages, developer guides, or any static HTML source where code tags carry meaningful attributes. Prefer this over general-purpose scrapers when the target is specifically a code element and precision attribute extraction (not full-page scraping) is the goal.

## Known failure modes

- URL is unreachable or returns a non-200 status, resulting in no content to parse
- The specified term does not match any code element on the page, returning an empty result
- The attribute name does not exist on the matched element, returning null or empty
- HTML exceeds the 100,000 character limit and is truncated or rejected
- JavaScript-rendered content is not available since only static HTML is parsed
- The page requires login or access control, which is not bypassed

## How this service works

Code snippets — Attribute extraction: Attribute extraction for Code snippets. One public HTTPS page or supplied HTML; static parsing, no JavaScript rendering, login or access bypass. Specialised preset in a shared 50-profile, 20-operation engine. 0.01 USDC includes one bounded attribute extraction result.

## Output

Returns the extracted value of the specified HTML attribute from the matched code snippet element on the provided page or HTML. The result is bounded to one attribute extraction per call, based on static HTML parsing with no JavaScript execution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "default": "",
   "maxLength": 2048
  },
  "html": {
   "type": "string",
   "default": "<!doctype html><html><head></head><body><code id=\"sample\" data-kind=\"example\">Example product guide</code></body></html>",
   "maxLength": 100000
  },
  "term": {
   "type": "string",
   "default": "product",
   "maxLength": 100,
   "minLength": 1
  },
  "attribute": {
   "type": "string",
   "default": "id",
   "pattern": "^[a-zA-Z][a-zA-Z0-9:_-]{0,49}$",
   "maxLength": 50
  },
  "previous_texts": {
   "type": "array",
   "items": {
    "type": "string",
    "default": "",
    "maxLength": 1000
   },
   "default": [
    "Older example"
   ],
   "maxItems": 200,
   "minItems": 0
  },
  "attribute_value": {
   "type": "string",
   "default": "sample",
   "maxLength": 200
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-snippets-attribute-extraction-f02429d4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
