{"uid":"cap_vVhNaPX-d83k8B97I3J4v","slug":"minify-html-ef116c29","name":"Minify HTML","description":"Minify HTML by collapsing whitespace and removing comments, with the bytes saved. Pure CPU, instant.","url":"https://api.gadgethumans.com/html-minify?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"object","properties":{"queryParams":{"type":"object","required":["html"],"properties":{"html":{"type":"string","description":"HTML text"}}}}},"output":{"type":"object","properties":{"example":{"ok":true}}}}},"responseSchema":{"type":"json","example":{"ok":true}},"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_KKCRxQoCsrtpSdD72_WUX","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":"Strips whitespace and comments from HTML text, returning the minified output and bytes saved.","exampleAgentPrompt":"Can you minify this HTML for me and tell me how many bytes I'll save? Here's the markup: <!DOCTYPE html><!-- page header --><html>  <body>  <h1>  Hello  </h1>  </body></html>","exampleUseCases":[{"title":"Optimize HTML before deployment","prompt":"Before I push this page live, can you minify the HTML to strip out all the comments and extra whitespace? Here's the full HTML string: <!DOCTYPE html><!-- nav comment --><html>  <head>  <title>  My Site  </title>  </head>  <body>  <p>  Welcome  </p>  </body></html>"},{"title":"Measure HTML compression savings","prompt":"I want to know how many bytes I'd save if I minified my HTML snippet — can you run it through minification and report the size reduction? The HTML is: <!-- hero section -->  <div class='hero'>   <h1>  Big Headline  </h1>   <p>  Subtext here  </p>  </div>"},{"title":"Strip comments from generated HTML","prompt":"My template engine outputs HTML with a lot of inline comments and extra indentation — can you collapse all that whitespace and remove the comments from this string: <!-- generated by template v2 -->  <ul>  <li>  Item 1  </li>  <li>  Item 2  </li>  </ul>?"}],"resultDescription":"A JSON object with an `ok` boolean indicating success, the minified HTML string, and a count of bytes saved compared to the original input.","failureModes":["Missing or empty `html` query parameter returns an error","Malformed HTML may still be processed but output quality is best-effort","Extremely large HTML strings may exceed query parameter size limits","Network or service errors return a non-ok response"],"whenToPreferThis":"Choose this endpoint when you need a fast, synchronous, CPU-only HTML minification with an explicit byte-savings report — ideal for single-string payloads where you don't want a full build pipeline. It's simpler and cheaper than integrating a Node.js bundler or build tool for one-off or on-demand minification tasks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-30T18:30:48.808Z","isFirstParty":false,"canonicalSlug":"minify-html-ef116c29"}