Skip to main content

Remove punctuation API

Delete punctuation and symbols from text while keeping letters, digits, accents and line structure.

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

When to call it

Search keys, fuzzy matching and simple language processing all work better on words alone. Normalising both sides of a comparison the same way is what makes the match land, and doing it in one endpoint is how both sides stay the same.

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-punctuation \
  -H "Authorization: Bearer ast_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello, world! Isn't this... something?"}'
response
{
  "tool": "remove-punctuation",
  "result": "Hello world Isnt this something",
  "chars": 31,
  "ms": 1
}

In your language

JavaScript
const res = await fetch("https://astraltext.com/api/v1/remove-punctuation", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"input": "Hello, world! Isn't this... something?"}),
});
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-punctuation",
    headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
    json={"input": "Hello, world! Isn't this... something?"},
    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 apostrophes removed?
Yes, so a contraction becomes one word. That is what you want for a search key and not what you want for display.
Is the spacing preserved?
Yes. Punctuation is removed and the spacing around it is left as it was, so words do not run together.
What about non-English punctuation?
Unicode punctuation is covered, including the guillemets and the ideographic full stop, not only the ASCII marks.

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