# Code Snippets — Distinct Value Extraction

> Code Snippets — Distinct Value 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-17).

Extracts unique/distinct values of a specified HTML attribute from all code snippet elements on a given webpage or HTML string.

## Facts

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

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-distinct-value-extraction-e8bdf599 -d '<json body>'
```

Example prompt: From the page at https://docs.example.com/api-reference, extract all distinct values of the data-kind attribute found on code snippet elements — skip any that match 'Older example' since I've already seen those.

## When to prefer this

Choose this endpoint when you need to extract and deduplicate a specific HTML attribute's values from code snippet elements on a static webpage or raw HTML, without needing JavaScript execution or authenticated browsing. It is ideal for cataloging unique identifiers, data attributes, or labels across code blocks in documentation, tutorials, or API reference pages.

## Known failure modes

- URL is inaccessible, behind a login, or requires JavaScript rendering — static parsing will return empty or partial results
- HTML exceeds 100,000 character limit — request rejected
- Attribute name does not match the allowed pattern (must start with a letter, alphanumeric/colon/underscore/hyphen, max 50 chars)
- No code snippet elements found matching the term or attribute filter — returns empty distinct set
- URL and HTML both omitted — engine may default to empty result
- More than 200 items in previous_texts — request rejected

## How this service works

Code snippets — Distinct value extraction: Distinct value 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 distinct value extraction result.

## Output

Returns a bounded set of distinct (deduplicated) values for the specified attribute across all code snippet elements found on the page or in the supplied HTML, excluding any values already provided in the previous_texts list.

## 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-distinct-value-extraction-e8bdf599/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)
