{"uid":"cap_dtKNrq3fqD6L4VwK0B1ZF","slug":"mcp-security-agentdiet-dev-web-url-distillation-compression-api-1c697335","name":"Web URL Distillation & Compression API","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://mcp-security.agentdiet.dev/v1/web-scrape)","url":"https://mcp-security.agentdiet.dev/v1/web-scrape?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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"}}}}},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.001","displayCostAsset":"USD","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_38EzfkuOb30t-sLYului0","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mcp-security.agentdiet.dev","brandSlug":"mcp-security-agentdiet-dev-mpp","brandBaseUrl":"https://mcp-security.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a webpage URL (or raw HTML) and distills it into compact, token-efficient agent-ready content using BM25 budget control and multiple extraction modes","exampleAgentPrompt":"Fetch https://stripe.com/docs/payments and distill it into compact markdown, keeping it under 1000 tokens focused on 'payment intents setup'.","exampleUseCases":[{"title":"Grounding agent on live documentation","prompt":"Go to https://docs.openai.com/api-reference and distill the page into clean markdown under 800 tokens focused on 'rate limits' so I can use it as context."},{"title":"Token-budget research from news article","prompt":"Fetch this article at https://techcrunch.com/2025/01/15/ai-agents-future and give me a skeleton outline of the main sections — keep it tight, no fluff."},{"title":"Structured data extraction from product page","prompt":"Pull https://www.shopify.com/pricing and extract the content in structured mode so I can see the pricing tiers and plan features as a JSON table."}],"resultDescription":"Returns a 'data' object containing distilled page content in the requested format (Markdown, structured JSON tables/metadata, skeleton outline, or BM25-focused excerpt), plus an roi_proof object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD. Also includes optional cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 HTTP status — endpoint may return an error status","URL points to a paywalled or login-gated page — content may be incomplete or empty","max_tokens is set below 20 — request is rejected per schema minimum","BM25 query is missing when mode=budget — results may be unfiltered or endpoint errors","Raw HTML passed via 'html' parameter is malformed — distillation quality degrades","Payment not provided — HTTP 402 response with payment required header","Rate limits or downstream fetch timeouts on very large pages"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to consume web page content without blowing its context window — especially when token cost and LLM efficiency matter. It is ideal over raw fetch/scrape tools when you need controlled token budgets (mode=budget with BM25 query focusing), clean Markdown for LLM ingestion, or structured JSON extraction from live pages. Prefer this over general search endpoints when you already have a specific URL and want its content distilled, not a list of search results.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:35.309Z","isFirstParty":false,"canonicalSlug":"mcp-security-agentdiet-dev-web-url-distillation-compression-api-1c697335"}