Skip to main content

Remove emoji API

Strip emoji, flags and skin tone modifiers, including the multi-character sequences that break naive filters.

EndpointPOST https://astraltext.com/api/v1/remove-emoji
AuthBearer token, free
Sendsinput: text
Returnsresult: text
PriceFree. 1,000 calls a day, 60 a minute.

When to call it

Emoji break fixed-width reports, legacy encodings, SMS billing and anything that counts characters to bill or truncate. Removing them server-side means user input is safe before it reaches the system that cannot handle it.

For a one-off, the browser version needs no token and never sends your data anywhere: it runs on your own machine.

Example

curl
curl -X POST https://astraltext.com/api/v1/remove-emoji \
  -H "Authorization: Bearer ast_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input": "Shipped πŸš€ the release πŸ‘©β€πŸ’» today πŸ‘πŸ½"}'
response
{
  "tool": "remove-emoji",
  "result": "Shipped the release today",
  "chars": 25,
  "ms": 1
}

In your language

JavaScript
const res = await fetch("https://astraltext.com/api/v1/remove-emoji", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"input": "Shipped πŸš€ the release πŸ‘©β€πŸ’» today πŸ‘πŸ½"}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const { result } = await res.json();
Python
import os, requests

res = requests.post(
    "https://astraltext.com/api/v1/remove-emoji",
    headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
    json={"input": "Shipped πŸš€ the release πŸ‘©β€πŸ’» today πŸ‘πŸ½"},
    timeout=30,
)
res.raise_for_status()
result = res.json()["result"]

Parameters

FieldTypeNotes
inputstringRequired. Up to 200,000 characters per call.

Errors

Errors are RFC 7807 problem documents with a stable type you can branch on.

missing-token401No Authorization header.
bad-request400input missing or the wrong type.
tool-failed422The input could not be processed. detail says why.
quota-exceeded429Past 1,000 calls today.

Questions

Are multi-part emoji handled?
Yes. A family or a professional emoji is several code points joined by zero-width joiners; the whole sequence goes, along with its joiners, rather than leaving orphaned fragments behind.
What about skin tone modifiers?
They are part of the sequence and go with it. Variation selectors are removed too, so no stray formatting character is left in the string.
Does it leave double spaces behind?
An emoji surrounded by spaces leaves its spaces, since collapsing them would be a different decision. Follow with the fix-spacing endpoint if you want them tidied.

Other endpoints

A token takes thirty seconds

Free, no card, 1,000 calls a day, and the same token works on astraltext.com, astralpdf.com, astraljson.com and astralbatch.com.

Get a free token