Remove punctuation API
Delete punctuation and symbols from text while keeping letters, digits, accents and line structure.
| Endpoint | POST https://astraltext.com/api/v1/remove-punctuation |
| Auth | Bearer token, free |
| Sends | input: text |
| Returns | result: text |
| Price | Free. 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
| Field | Type | Notes |
|---|---|---|
| input | string | Required. Up to 200,000 characters per call. |
Errors
Errors are RFC 7807 problem documents with a stable type you can branch on.
| missing-token | 401 | No Authorization header. |
| bad-request | 400 | input missing or the wrong type. |
| tool-failed | 422 | The input could not be processed. detail says why. |
| quota-exceeded | 429 | Past 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
- AI text cleaner API
- Remove em dashes API
- Remove invisible characters API
- Remove emoji API
- Remove line breaks API
- Strip Markdown API
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