# Webpage Distiller — Compact Agent-Ready Token Extractor

> Webpage Distiller — Compact Agent-Ready Token Extractor is a paid API for AI agents from shopify-spy.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown (last checked 2026-10-21).

Fetches a URL or accepts raw HTML and distills it into compact, token-efficient markdown, structured JSON, skeleton outline, or BM25-focused budget excerpt for AI agent consumption.

## Facts

- Endpoint: GET https://shopify-spy.agentdiet.dev/v1/webpage-distiller?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: shopify-spy.agentdiet.dev
- Website: https://shopify-spy.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/shopify-spy-agentdiet-dev-webpage-distiller-compact-agent-ready-token-26f6d12a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oemgNtrbd-PnGaal8knI0

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 shopify-spy-agentdiet-dev-webpage-distiller-compact-agent-ready-token-26f6d12a
```

Example prompt: Distill the content at https://docs.stripe.com/payments/accept-a-payment into compact markdown — use budget mode with the query 'accept payment intent' and cap it at 500 tokens.

## When to prefer this

Choose this endpoint when your agent needs to read web pages or HTML documents without exhausting its token budget — especially for documentation, product pages, or research pages. Prefer it over raw HTTP fetches when LLM cost or context window size is a concern, or when you need structured extraction (tables, metadata) rather than raw HTML. The BM25 budget mode is particularly valuable when you only need the section of a page relevant to a specific query.

## Known failure modes

- URL is unreachable or returns non-200 status — endpoint may return an error status
- URL resolves to a bot-protected or JavaScript-heavy page that cannot be fetched server-side
- max_tokens set too low to produce meaningful output (minimum 20)
- Invalid mode enum value causes request rejection
- Raw HTML payload is malformed or empty — distillation may return empty data
- BM25 query in budget mode finds no relevant passage — distilled output may be near-empty
- Payment/x402 authorization failure — call not executed

## How this service works

Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://shopify-spy.agentdiet.dev/v1/webpage-distiller)

## Output

Returns a JSON object with a 'data' field containing the distilled content (markdown text, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt depending on mode), plus an 'roi_proof' object showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, roi_multiplier, and llm_cost_saved_usd. Also includes cache status (HIT/MISS) and billing details.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "minLength": 1,
   "description": "Target webpage URL to fetch and distill (or builtin://stripe-docs)"
  },
  "html": {
   "type": "string",
   "description": "Optional raw HTML string to distill directly without fetching"
  },
  "mode": {
   "enum": [
    "markdown",
    "structured",
    "skeleton",
    "budget"
   ],
   "type": "string",
   "default": "markdown",
   "description": "Distillation mode"
  },
  "query": {
   "type": "string",
   "description": "BM25 focus query when mode=budget"
  },
  "max_tokens": {
   "type": "integer",
   "minimum": 20,
   "description": "Strict token budget ceiling when mode=budget"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "status",
  "roi_proof",
  "data"
 ],
 "properties": {
  "data": {
   "type": "object",
   "description": "Distilled Markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt."
  },
  "cache": {
   "type": "object",
   "properties": {
    "status": {
     "enum": [
      "HIT",
      "MISS"
     ],
     "type": "string"
    },
    "cache_key": {
     "type": "string"
    },
    "latency_ms": {
     "type": "number"
    }
   }
  },
  "status": {
   "type": "string",
   "description": "Execution status ('ok')"
  },
  "billing": {
   "type": "object",
   "properties": {
    "agent_id": {
     "type": "string"
    },
    "payment_method": {
     "type": "string"
    },
    "fee_charged_usd": {
     "type": "number"
    }
   }
  },
  "roi_proof": {
   "type": "object",
   "properties": {
    "raw_tokens": {
     "type": "integer"
    },
    "tokens_saved": {
     "type": "integer"
    },
    "roi_multiplier": {
     "type": "number"
    },
    "distilled_tokens": {
     "type": "integer"
    },
    "llm_cost_saved_usd": {
     "type": "number"
    },
    "compression_ratio_pct": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/shopify-spy-agentdiet-dev-webpage-distiller-compact-agent-ready-token-26f6d12a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from shopify-spy.agentdiet.dev](https://www.zero.xyz/host/shopify-spy.agentdiet.dev/llms.txt)
