{"uid":"cap_x-69iHilADEGSTvHPCA3n","slug":"agent402-html-to-markdown-converter-f4bdf94d","name":"Agent402 HTML to Markdown Converter","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/utils/html/to-markdown","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"html":{"type":"string","description":"HTML fragment"}}},"responseSchema":{"type":"json","example":{"valid":true,"markdown":"# Hi\n\nHello **world**","approx_tokens":5}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KavGUTNaLlYjD56ex_AZB","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts an HTML fragment to Markdown text and returns an approximate token count for context management","exampleAgentPrompt":"Convert this HTML fragment to markdown and tell me roughly how many tokens it'll take up: '<h1>Welcome</h1><p>Hello <strong>world</strong>, this is a <a href=\"#\">test</a>.</p>'","exampleUseCases":[{"title":"Mid-task context window shrink","prompt":"I have a big HTML blob from a scraped page that I need to fit into my context window — can you convert it to markdown and tell me the approximate token count so I know if it'll fit?"},{"title":"LLM-ready content extraction","prompt":"Take this HTML article fragment and convert it to clean markdown so I can feed it directly into my summarization step without all the tag noise."},{"title":"Token budget estimation before processing","prompt":"Before I send this HTML to the model, convert it to markdown and give me an approximate token count so I can decide whether to chunk it or send it whole."}],"resultDescription":"A JSON object with three fields: 'valid' (boolean indicating whether conversion succeeded), 'markdown' (the converted Markdown string), and 'approx_tokens' (an integer approximation of the token count of the resulting markdown).","failureModes":["Malformed or non-HTML input may still be processed best-effort but 'valid' may be false","Very large HTML fragments may produce inaccurate token counts","Dynamic or JavaScript-rendered content won't be executed — only static HTML is parsed","Deeply nested or exotic HTML structures may produce imperfect markdown","Empty input string returns minimal or empty markdown"],"whenToPreferThis":"Choose this endpoint when an agent needs a lightweight, pay-per-call HTML-to-Markdown conversion with an approximate token count included — especially useful mid-task for context window management. It is not a browser or renderer, so prefer it for static HTML fragments rather than JavaScript-heavy pages. Pair with text-metrics endpoints if precise token counts are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T10:25:27.029Z","isFirstParty":false}