{"openapi":"3.1.0","info":{"title":"HTML Sanitizer API","version":"1.0.0","description":"Make untrusted HTML safe to display. Send any HTML — a comment, a rich-text submission, a snippet from an email or a scraped page — and get back a clean, XSS-free version: <script> tags, inline event handlers (onclick, onerror), javascript: URLs, <iframe>, <style> and anything not on the allowlist are removed. Override the allowed tags and attributes to fit your needs, or drop links entirely. A strip endpoint returns plain text with all markup removed. Pure local sanitization — no key, no third-party service, instant. Live. 3 endpoints. Built for user-generated content, comment systems, rich-text editors, email rendering and any place untrusted HTML reaches a browser. Distinct from a Markdown renderer or an HTML data extractor.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/htmlsanitize-api","description":"oanor gateway"}],"tags":[{"name":"Sanitize"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/sanitize":{"get":{"operationId":"get_v1_sanitize","tags":["Sanitize"],"summary":"Sanitize untrusted HTML","description":"","parameters":[{"name":"html","in":"query","required":true,"description":"HTML to sanitize","schema":{"type":"string"},"example":"<p>Hi <b>x</b><script>alert(1)</script><a href=\"javascript:e()\">a</a></p>"},{"name":"allowed_tags","in":"query","required":false,"description":"Comma-separated allowlist (override default)","schema":{"type":"string"}},{"name":"allowed_attributes","in":"query","required":false,"description":"Comma-separated attributes allowed on any tag","schema":{"type":"string"}},{"name":"allow_links","in":"query","required":false,"description":"false to drop anchor tags","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"modified":true,"sanitized":"<p>Hi <b>x</b><a>a</a></p>","original_length":73,"sanitized_length":26},"meta":{"timestamp":"2026-06-02T16:51:54.105Z","request_id":"2d2348cf-c246-4ee0-9375-8168468fea7c"},"status":"ok","message":"Sanitize HTML","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/strip":{"get":{"operationId":"get_v1_strip","tags":["Sanitize"],"summary":"Strip all HTML to plain text","description":"","parameters":[{"name":"html","in":"query","required":true,"description":"HTML to strip","schema":{"type":"string"},"example":"<p>Hi <b>there</b></p>"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"text":"Hi there","length":8},"meta":{"timestamp":"2026-06-02T16:51:54.208Z","request_id":"23111dea-d94e-44b7-9c1d-9d6393910d46"},"status":"ok","message":"Strip HTML to text","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"auth":"none upstream; this gateway requires x-api-key","name":"HTML Sanitizer API","note":"Make untrusted HTML safe. /v1/sanitize?html=... removes scripts, event handlers, javascript: URLs, iframes/styles and any tags/attributes not on the allowlist (override with allowed_tags=p,a,b and allowed_attributes=href,src; allow_links=false to drop anchors). /v1/strip?html=... returns plain text. For comments, user-generated content, rich-text editors and email. Instant, nothing stored.","source":"Local sanitization (sanitize-html) — no key, no upstream","endpoints":3},"meta":{"timestamp":"2026-06-02T16:51:54.305Z","request_id":"e56639ae-fe72-49c5-a443-ed25a2428363"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1240,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":420,"monthly_call_quota":15000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2380,"monthly_call_quota":156000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5980,"monthly_call_quota":800000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/htmlsanitize-api"}