# Web URL to Compact Markdown Distiller

> Web URL to Compact Markdown Distiller is a paid API for AI agents from whale-momentum.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown (last checked 2026-10-21).

Fetches a webpage URL (or raw HTML) and distills it into compact, agent-ready Markdown, structured JSON, a skeleton outline, or a BM25-budget-controlled excerpt with token savings metrics

## Facts

- Endpoint: GET https://whale-momentum.agentdiet.dev/v1/docs-to-markdown?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: whale-momentum.agentdiet.dev
- Website: https://whale-momentum.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/whale-momentum-agentdiet-dev-web-url-to-compact-markdown-distiller-96ae3387
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XWh9NeM0oXLO-0dXIfaNT

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 whale-momentum-agentdiet-dev-web-url-to-compact-markdown-distiller-96ae3387
```

Example prompt: Can you fetch the Stripe docs page at https://stripe.com/docs/api and distill it into compact markdown, keeping it under 2000 tokens and focusing the BM25 query on 'payment intents'?

## When to prefer this

Choose this endpoint when an AI agent needs to read or reference web pages or documentation without exhausting its context window — especially for long API docs, research pages, or HTML-heavy sites. The BM25 budget mode is uniquely suited for targeted extraction when you only need content relevant to a specific query. Prefer this over raw HTML fetching whenever token cost and context efficiency matter. The structured and skeleton modes are ideal when you need machine-parseable tables or just a navigation outline rather than full prose.

## Known failure modes

- URL is unreachable or returns non-200 HTTP status — distillation fails with an error status
- HTML payload is malformed or empty — returns empty or minimal data object
- max_tokens is set too low (below 20) — rejected by schema validation
- BM25 query yields no matching tokens within budget — returns empty or minimal excerpt
- Rate limiting or payment failure via x402 — call rejected before processing
- Target page is behind authentication or CAPTCHA — fetch fails silently or returns login page content

## How this service works

Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://whale-momentum.agentdiet.dev/v1/docs-to-markdown)

## Output

Returns a JSON object with a 'data' field containing the distilled content (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), plus ROI proof metrics (raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, llm_cost_saved_usd, roi_multiplier), cache status (HIT/MISS), and billing info including fee charged in USD.

## 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/whale-momentum-agentdiet-dev-web-url-to-compact-markdown-distiller-96ae3387/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from whale-momentum.agentdiet.dev](https://www.zero.xyz/host/whale-momentum.agentdiet.dev/llms.txt)
