{"uid":"cap_Qqq1tJezQ79xEGCday08B","slug":"api-x402node-dev-2deadd51","name":"HTML Entity Encoder/Decoder","description":"HTML entity encoder/decoder, XSS prevention, named entities, numeric entities, and amp; and lt; and gt;, character escape. Escape user input for safe HTML. Accepts payment on Base or Solana — either network works.","url":"https://api.x402node.dev/encode/html","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["text"],"properties":{"mode":{"type":"string","description":"Operation mode (optional)"},"text":{"type":"string","description":"Input text (required)"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"text":"<script>alert('XSS')</script> & some \"quoted\" text"},"response":{"mode":"encode","_hint":"x402 paid endpoints for AI agents — x402node.dev (utilities) · cn402.com (Chinese culture)","input":"<script>alert('XSS')</script> & some \"quoted\" text","output":"&lt;script&gt;alert(&#39;XSS&#39;)&lt;&#x2F;script&gt; &amp; some &quot;quoted&quot; text"}},"exampleRequest":{"text":"<script>alert('XSS')</script> & some \"quoted\" text"},"tags":["x402"],"displayCostAmount":"0.0022","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.0022/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0022","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0022","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Mn_1cjTWNESR79XDP8uKH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0022","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes or decodes HTML entities in text to prevent XSS vulnerabilities and ensure safe HTML rendering","exampleAgentPrompt":"Encode this user-submitted comment so it's safe to inject into HTML and won't trigger XSS: '<script>alert(\"hacked\")</script> & some \"quoted\" text'.","exampleUseCases":null,"resultDescription":"Returns the input text with all HTML special characters converted to their safe entity equivalents (e.g. < becomes &lt;, > becomes &gt;, & becomes &amp;, \" becomes &quot;), preventing XSS when the output is rendered in a browser.","failureModes":["Empty or missing input body returns an error","Extremely large payloads may be rejected","Malformed JSON request body causes 400 error","Non-text binary content may not encode correctly"],"whenToPreferThis":"Use this endpoint when you need to safely insert user-generated or untrusted text into HTML pages, templates, or email bodies, and want to prevent XSS attacks. Prefer this over manual string replacement when you need comprehensive coverage of all HTML special characters including named and numeric entities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:51:10.492Z","isFirstParty":false}