Call the free HTML decode API endpoint
curl -X POST https://aisenseapi.com/services/v1/html_decode \
-H "Content-Type: application/json" \
-d '{"data": "<b> & é é"}'{"html_decoded_data":"<b> & é é"}The other way is the HTML encode API endpoint.
What is decoded
| In | Out |
|---|---|
< > & " ' | < > & " ' |
café & crème | café & crème |
é é | é é |
| a no-break space, U+00A0 |
Markup is not removed: <b> becomes <b>, as text.
Send the data as {"data": "..."} with Content-Type: application/json, or as the raw request body with any other content type. The raw body takes binary data as it is: curl --data-binary @file.bin -H "Content-Type: application/octet-stream".
Errors
| Status | error | When |
|---|---|---|
| 400 | No data to decode. | No data string and no body |
| 400 | The data is not UTF-8 text. | Bytes that are not text |
| 413 | Data over 1 MiB. | More than 1 MiB in one request |
Each refusal also carries fix, a sentence saying what to send instead.
Common uses
Clean scraped text
Turn the entities in text taken from a page back into the characters a reader sees.
Feeds and mail
RSS titles and email bodies often carry entities; decode them before storing or comparing.
Agents reading HTML
Give an agent plain characters to reason about instead of escape sequences.
Privacy and limits
Nothing is stored. The HTML decode answer is worked out while the request is open and the data is gone with it. The access log records the path and the status, not the body.
The base URL is https://aisenseapi.com/services/v1. There is no key, no account and no sign-up step. One request carries at most 1 MiB of data, and the service-wide limit is 5000 requests per IP address per day. Every endpoint in the collection is listed on the Free public REST APIs reference, and the encodings side by side on Encoding APIs.