# URL to Markdown Web Distiller

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

Fetches a web page by URL and converts it into compact, token-efficient markdown or structured output for AI agent consumption

## Facts

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

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 json-repair-agentdiet-dev-url-to-markdown-web-distiller-d49e78a1
```

Example prompt: Can you distill https://stripe.com/docs/api into compact markdown so I can feed it to my agent without blowing the token budget — use budget mode with a max of 2000 tokens and focus the BM25 query on 'payment intents'?

## When to prefer this

Choose this endpoint when an AI agent needs to ingest web content with strict token budgets — especially when raw HTML would be too verbose or expensive to process directly. The BM25 budget mode makes it uniquely suited for targeted information retrieval from long pages. Prefer over generic scrapers when token efficiency and cost savings (tracked via roi_proof) matter, or when you need structured JSON tables extracted from a page rather than raw text.

## Known failure modes

- Invalid or unreachable URL returns an error status
- max_tokens below minimum of 20 causes a validation error
- BM25 query provided without mode=budget may be ignored
- Paywalled or JavaScript-heavy pages may return incomplete content
- Payment not processed (402) if x402 payment header is missing or insufficient

## How this service works

Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://json-repair.agentdiet.dev/v1/url-to-markdown)

## Output

Returns a JSON object containing distilled content in one of four formats (markdown, structured JSON, skeleton outline, or BM25 budget excerpt), plus an roi_proof object showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd. Also includes cache hit/miss status and billing details.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "minLength": 1,
   "description": "Target webpage URL to distill (or builtin://stripe-docs)"
  },
  "mode": {
   "enum": [
    "markdown",
    "structured",
    "skeleton",
    "budget"
   ],
   "type": "string",
   "default": "markdown",
   "description": "Extraction mode: markdown, structured, skeleton, or budget"
  },
  "query": {
   "type": "string",
   "description": "BM25 focus query when mode=budget"
  },
  "max_tokens": {
   "type": "integer",
   "minimum": 20,
   "description": "Strict token 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/json-repair-agentdiet-dev-url-to-markdown-web-distiller-d49e78a1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from json-repair.agentdiet.dev](https://www.zero.xyz/host/json-repair.agentdiet.dev/llms.txt)
