{"profile":"basic","original_length":131,"clean_length":143,"removed_bytes":-12,"clean":"{\"html\": \"<p>Hello <b>world</b>, this is <i>rich</i> text with a <a href=\"\\"https://example.com\\"\">link</a></p>\", \"profile\": \"strip\"}"}
curl --location --request POST 'https://zylalabs.com/api/13167/web+content+sanitizer+api/26714/sanitize+web+content' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"html": "Hello world, this is rich text with a link
", "profile": "strip"}'
Después de registrarte, a cada desarrollador se le asigna una clave de acceso a la API personal, una combinación única de letras y dígitos proporcionada para acceder a nuestro endpoint de la API. Para autenticarte con el Web Content Sanitizer API simplemente incluye tu token de portador en el encabezado de Autorización.
| Encabezado | Descripción |
|---|---|
Autorización
|
Requerido
Debería ser Bearer access_key. Consulta "Tu Clave de Acceso a la API" arriba cuando estés suscrito.
|
Sin compromiso a largo plazo. Mejora, reduce o cancela en cualquier momento. La Prueba Gratuita incluye hasta 50 solicitudes.
(Ahorra 2 meses pagando anualmente 🎉)
Empresas líderes confían en nosotros
Make user submitted markup safe before it reaches your pages. One call strips scripts, inline event handlers and dangerous attributes while preserving harmless formatting.
Useful for user comments and reviews, rich text editor output before storage, markup arriving from messages or external hooks, and scraped content displayed inside your product.
The Sanitize Web Content endpoint returns a JSON object containing the cleaned HTML markup, the profile used for sanitization, the original length of the input, the cleaned length, and the number of bytes removed during the process.
The key fields in the response data include "profile" (the sanitization profile used), "original_length" (length of the input markup), "clean_length" (length of the sanitized markup), "removed_bytes" (number of bytes removed), and "clean" (the sanitized HTML content).
The endpoint accepts parameters such as "markup" (the HTML content to be sanitized) and "profile" (to specify the cleaning profile: plain text, safe formatting, or relaxed). Users can also provide a custom allowed tag list.
The response data is organized as a JSON object. It includes fields for the profile used, lengths of the original and cleaned markup, the number of bytes removed, and the cleaned HTML content itself, making it easy to parse and utilize.
Typical use cases include sanitizing user comments and reviews, cleaning rich text editor output before storage, processing markup from messages or external hooks, and ensuring scraped content is safe for display within applications.
Users can customize their requests by selecting different sanitization profiles (plain text, safe formatting, relaxed) and by providing a custom allowed tag list to control which HTML tags are preserved during the sanitization process.
En la respuesta "perfil" indica el método de sanitización utilizado "longitud_original" muestra la longitud del marcado de entrada "longitud_limpia" indica la longitud de la salida sanitizada "bytes_eliminados" refleja la cantidad de datos eliminados y "limpio" contiene el HTML sanitizado
Se mantiene la precisión de los datos utilizando perfiles de limpieza predefinidos que eliminan de manera consistente elementos dañinos mientras preservan el formato seguro La API también proporciona retroalimentación sobre la cantidad de datos eliminados permitiendo a los usuarios evaluar la efectividad de la sanitización