{"uid":"cap_oemgNtrbd-PnGaal8knI0","slug":"shopify-spy-agentdiet-dev-webpage-distiller-compact-agent-ready-token-26f6d12a","name":"Webpage Distiller — Compact Agent-Ready Token Extractor","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://shopify-spy.agentdiet.dev/v1/webpage-distiller)","url":"https://shopify-spy.agentdiet.dev/v1/webpage-distiller?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_Ves-tFO1SnBKFUqvO7AlL","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"shopify-spy.agentdiet.dev","brandSlug":"shopify-spy-agentdiet-dev-mpp","brandBaseUrl":"https://shopify-spy.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and distills it into compact, token-efficient markdown, structured JSON, skeleton outline, or BM25-focused budget excerpt for AI agent consumption.","exampleAgentPrompt":"Distill the content at https://docs.stripe.com/payments/accept-a-payment into compact markdown — use budget mode with the query 'accept payment intent' and cap it at 500 tokens.","exampleUseCases":[{"title":"Cheap documentation ingestion for agent","prompt":"Grab the content from https://docs.openai.com/api-reference and distill it into markdown so my agent can read it without burning through my token budget."},{"title":"BM25 focused research extraction","prompt":"I need just the pricing section from https://vercel.com/pricing — distill it in budget mode with the query 'pro plan pricing' and keep it under 300 tokens."},{"title":"Structured data extraction from product page","prompt":"Fetch https://www.apple.com/shop/buy-iphone and distill it in structured mode so I get the product tables and metadata as JSON."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (markdown text, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt depending on mode), plus an 'roi_proof' object showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, roi_multiplier, and llm_cost_saved_usd. Also includes cache status (HIT/MISS) and billing details.","failureModes":["URL is unreachable or returns non-200 status — endpoint may return an error status","URL resolves to a bot-protected or JavaScript-heavy page that cannot be fetched server-side","max_tokens set too low to produce meaningful output (minimum 20)","Invalid mode enum value causes request rejection","Raw HTML payload is malformed or empty — distillation may return empty data","BM25 query in budget mode finds no relevant passage — distilled output may be near-empty","Payment/x402 authorization failure — call not executed"],"whenToPreferThis":"Choose this endpoint when your agent needs to read web pages or HTML documents without exhausting its token budget — especially for documentation, product pages, or research pages. Prefer it over raw HTTP fetches when LLM cost or context window size is a concern, or when you need structured extraction (tables, metadata) rather than raw HTML. The BM25 budget mode is particularly valuable when you only need the section of a page relevant to a specific query.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:24:46.731Z","isFirstParty":false,"canonicalSlug":"shopify-spy-agentdiet-dev-webpage-distiller-compact-agent-ready-token-26f6d12a"}