# AgentDiet SPA Markdown Reader

> AgentDiet SPA Markdown Reader is a paid API for AI agents from rag-diet.agentdiet.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-22).

Fetches a web page (including single-page apps) and converts it to compressed, token-efficient Markdown for AI agent consumption

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/spa-markdown-reader?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-spa-markdown-reader-dbac9d45
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gM1c0dsssAWOAF6bsAoec

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 agentdiet-spa-markdown-reader-dbac9d45
```

Example prompt: Can you fetch https://docs.example.com/getting-started and convert it to compact markdown — I need to fit it into my context window without burning a ton of tokens?

## When to prefer this

Choose this endpoint when you need to fetch and read web pages — especially JavaScript-rendered single-page apps — inside an AI agent pipeline where token efficiency is critical. It is particularly valuable when the raw HTML would be too large for the context window and you need aggressive compression (up to 91%+ reduction). Prefer it over generic scrapers when you need clean Markdown output optimized for LLM consumption, and when you are already operating in an x402/USDC micropayment environment on Base.

## Known failure modes

- URL is unreachable or returns non-200 — endpoint may return an error status
- JavaScript-heavy SPA fails to render fully before extraction
- URL parameter missing — request rejected
- Paywalled or bot-blocked pages may return incomplete or empty content
- Payment not settled in USDC on Base — x402 payment required before content is returned

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.

## Output

A JSON object with status 'ok', a data field containing the page content converted to Markdown, and an roi_proof object showing the compression_ratio_pct (e.g. 91.4%) achieved relative to the raw HTML input.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "mode": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-spa-markdown-reader-dbac9d45/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rag-diet.agentdiet.dev](https://www.zero.xyz/host/rag-diet.agentdiet.dev/llms.txt)
