{"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"}'
Após se cadastrar, cada desenvolvedor recebe uma chave de acesso à API pessoal, uma combinação única de letras e dígitos para acessar nosso endpoint de API. Para autenticar com a Web Content Sanitizer API basta incluir seu token Bearer no cabeçalho Authorization.
| Cabeçalho | Descrição |
|---|---|
Authorization
|
Obrigatório
Deve ser Bearer access_key. Veja "Sua chave de acesso à API" acima quando você estiver inscrito.
|
Sem compromisso de longo prazo. Faça upgrade, downgrade ou cancele a qualquer momento. O teste gratuito inclui até 50 requisições.
(Economize 2 meses com cobrança anual 🎉)
Empresas líderes confiam em nós
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.
Na resposta "perfil" indica o método de sanitização utilizado "comprimento_original" mostra o comprimento da marcação de entrada "comprimento_limpo" indica o comprimento da saída sanitizada "bytes_removidos" reflete a quantidade de dados removidos e "limpo" contém o HTML sanitizado
A precisão dos dados é mantida usando perfis de limpeza predefinidos que removem consistentemente elementos prejudiciais enquanto preservam a formatação segura A API também fornece feedback sobre a quantidade de dados removidos permitindo que os usuários avaliem a eficácia da sanitização