{"uid":"cap_tGbA6z506bEwVo1RkDMmg","slug":"arxiv-digest-agentdiet-dev-html-to-markdown-distiller-with-bm25-3d1c3eb2","name":"HTML to Markdown Distiller with BM25 Budget Control","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://arxiv-digest.agentdiet.dev/v1/html-to-markdown)","url":"https://arxiv-digest.agentdiet.dev/v1/html-to-markdown?utm_source=zero.xyz","method":"POST","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_UCGkBnQ8a5goR0sNfMg_R","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"arxiv-digest.agentdiet.dev","brandSlug":"arxiv-digest-agentdiet-dev-mpp","brandBaseUrl":"https://arxiv-digest.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and converts a URL or raw HTML into clean Markdown, structured JSON, or a BM25-ranked token-budgeted excerpt optimized for LLM consumption","exampleAgentPrompt":"Fetch https://arxiv.org/abs/2401.00001 and distill it into clean Markdown, keeping only the sections most relevant to 'transformer attention mechanisms' within a 800-token budget.","exampleUseCases":[{"title":"Token-budgeted research paper ingestion","prompt":"Grab https://arxiv.org/abs/2310.06825 and distill it using budget mode, focusing on 'diffusion model training' with a max of 600 tokens — I need just the relevant parts for my LLM pipeline."},{"title":"Documentation page to Markdown for agent context","prompt":"Fetch the Stripe API docs page at https://stripe.com/docs/api/charges and convert it to clean Markdown so I can include it in my agent's context window."},{"title":"Structured data extraction from raw HTML","prompt":"I have this raw HTML snippet from a product listing page — can you distill it into structured JSON tables pulling out the pricing, specs, and metadata?"}],"resultDescription":"Returns a JSON object containing the distilled content (Markdown, structured JSON, skeleton, or BM25 excerpt) under 'data', an ROI proof object showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd, plus optional cache status and billing details.","failureModes":["URL is unreachable or returns non-200 HTTP status — endpoint may return an error status","HTML payload is malformed or empty — distillation may return minimal or empty output","mode=budget used without providing a query — BM25 ranking cannot focus without a query string","max_tokens set too low (below 20) — rejected by schema validation","Payment not provided or insufficient — HTTP 402 returned blocking execution","Target URL blocks bot crawlers — fetch may fail or return CAPTCHA HTML"],"whenToPreferThis":"Choose this endpoint when you need to feed live web content to an LLM but want to minimize token usage and cost. It is especially valuable when you have a strict token budget (use mode=budget with a BM25 query to surface only the most relevant content), or when you need clean Markdown rather than raw HTML. Prefer it over generic scrapers when ROI measurement (compression ratio, cost saved) matters to your pipeline, or when you need structured JSON tables extracted from HTML without writing custom parsers.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:34:51.661Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-html-to-markdown-distiller-with-bm25-3d1c3eb2"}