{"uid":"cap_hNGe87VaYz31tN_r-b7jM","slug":"preflight-agentdiet-dev-semantic-html-pruner-web-url-distillation-api-4edb74b7","name":"Semantic HTML Pruner – Web URL Distillation API","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://preflight.agentdiet.dev/v1/semantic-html-pruner)","url":"https://preflight.agentdiet.dev/v1/semantic-html-pruner?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_jJgRE3LNcM-hNdPdbkwx-","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"preflight.agentdiet.dev","brandSlug":"preflight-agentdiet-dev-mpp","brandBaseUrl":"https://preflight.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and compresses it into compact, agent-ready tokens using BM25-ranked budget control and multiple distillation modes","exampleAgentPrompt":"Distill https://stripe.com/docs/payments into compact markdown, keeping only the most relevant content about payment intents, and cap it at 2000 tokens using budget mode with a query focused on 'payment intents'.","exampleUseCases":[{"title":"Token-efficient competitor research","prompt":"Fetch https://www.openai.com/pricing and distill it into structured markdown so I can compare their pricing tiers without blowing my context window."},{"title":"BM25-focused SEC filing extraction","prompt":"Pull https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=AAPL&type=10-K and extract only the sections about revenue and risk factors, using budget mode with a max of 1500 tokens and query 'revenue risk factors'."},{"title":"Skeleton outline of documentation site","prompt":"Give me a skeleton outline of https://docs.anthropic.com/en/docs/welcome so I can see the structure of their documentation without reading the full text."}],"resultDescription":"Returns a JSON object containing distilled content (Markdown, structured tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), ROI proof metrics (raw tokens, distilled tokens, tokens saved, compression ratio, estimated LLM cost saved), optional cache status (HIT/MISS), billing details, and an execution status field.","failureModes":["Invalid or unreachable URL returns an error status","HTML too large or malformed may cause incomplete distillation","budget mode without a query returns unranked content","max_tokens set too low may truncate critical content","Rate limiting or payment failure (402) blocks the request","Target site blocks automated fetching (bot protection)"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read web content that would otherwise exceed context window limits or drive up LLM token costs. It is especially valuable when working with long documentation pages, news articles, or SEC filings where only a subset of content is needed. Prefer this over raw HTTP fetching when token efficiency matters, or when you want structured/skeleton output rather than raw HTML noise. The BM25 budget mode is uniquely suited for topic-focused extraction within a strict token ceiling.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:16.410Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-semantic-html-pruner-web-url-distillation-api-4edb74b7"}