{"uid":"cap_7HQjIXyKTNyI0TvVwJr7e","slug":"html-to-markdown-token-compressor-7732e8bd","name":"HTML to Markdown Token Compressor","description":"Convert raw HTML into clean Markdown for LLM and AI-agent context windows. Removes scripts, styles, navigation, headers, footers, and optionally images or links, then returns measured token-reduction metrics. The caller supplies HTML directly; this service does not fetch URLs.","url":"https://html2md-converter.onrender.com/v1/markdown/convert","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"html":{"type":"string","maxLength":10000000,"minLength":1,"description":"Raw HTML supplied directly by the caller. URLs are not fetched."},"options":{"type":"object","properties":{"stripLinks":{"type":"boolean","default":false,"description":"Preserve link text while removing destination URLs."},"stripImages":{"type":"boolean","default":false,"description":"Remove image elements before Markdown conversion."}},"additionalProperties":false}}},"responseSchema":{"type":"json","example":{"metrics":{"input":{"bytes":105,"chars":105,"tokens":32},"output":{"bytes":30,"chars":30,"tokens":7},"savings":{"tokensSaved":25,"estimatedTokenRatio":"4.6x","percentageReduction":"78.13%"}},"markdown":"# Hello Agent\n\nUseful content."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Ue8cbCR4gfQj-WFedyeTe","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts raw HTML strings to Markdown and reports token reduction metrics for AI agent context optimization","exampleAgentPrompt":"Convert this raw HTML into Markdown and tell me how many tokens I'm saving — I want to compress it before feeding it into my LLM pipeline: <html><body><h1>Hello World</h1><p>This is a test page.</p></body></html>","exampleUseCases":[{"title":"Web scrape compression for RAG pipeline","prompt":"I just scraped this product page HTML and I need to convert it to Markdown before adding it to my retrieval index — can you convert it and tell me the token reduction percentage? Here's the HTML: <html><body><h1>Product Name</h1><p>Description here.</p><ul><li>Feature 1</li></ul></body></html>"},{"title":"Summarizing a news article fetched from the web","prompt":"I fetched this news article as raw HTML and I need to pass it to GPT-4, but it's too token-heavy — convert it to Markdown so I can see how much I shrink the context: <html><head><title>Breaking News</title></head><body><article><h2>Story Headline</h2><p>Full article text here...</p></article></body></html>"},{"title":"Preprocessing a documentation page for an AI assistant","prompt":"Take this raw HTML from our developer docs site and turn it into clean Markdown — I want to embed it in a system prompt without blowing up my token budget: <html><body><h1>API Reference</h1><p>Use the following endpoints...</p><code>GET /v1/data</code></body></html>"}],"resultDescription":"Returns a JSON object containing the converted Markdown string and a metrics object with input token count, output token count, and percentage token reduction achieved by the conversion.","failureModes":["Missing or empty 'html' field returns a validation error","Malformed or extremely large HTML may cause timeout or processing failure","Non-HTML input (e.g. plain text or JSON) may produce poorly structured Markdown","Service unavailability on the hosted render.com instance returns 503"],"whenToPreferThis":"Choose this endpoint when an AI agent pipeline needs to convert raw HTML to Markdown specifically to reduce token consumption before passing content to an LLM. It is ideal for RAG preprocessing, web scraping pipelines, and any workflow where minimizing context window usage from HTML sources is a priority. The built-in token metrics make it easy to measure and validate compression gains without a separate counting step.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:36:07.599Z","isFirstParty":false}