Remove citations API
Strip [1] style citation markers, superscript numbers and trailing Sources lines from text, leaving the sentences and punctuation intact.
| Endpoint | POST https://astraltext.com/api/v1/remove-citations |
| Auth | Bearer token, free |
| Sends | input: text |
| Returns | result: text |
| Price | Free. 1,000 calls a day, 60 a minute. |
When to call it
Text lifted from an encyclopaedia, a research summary or a model that cites its sources arrives peppered with bracketed numbers. They point at a bibliography that did not come with the text, so in any new context they are just debris that breaks the reading and the word count.
For a one-off, the browser version needs no token and never sends your data anywhere: it runs on your own machine.
Example
curl -X POST https://astraltext.com/api/v1/remove-citations \
-H "Authorization: Bearer ast_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input": "The standard was published in 2005[1] and revised twice[2][3] since."}'{
"tool": "remove-citations",
"result": "The standard was published in 2005 and revised twice since.",
"chars": 59,
"ms": 1
}In your language
const res = await fetch("https://astraltext.com/api/v1/remove-citations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"input": "The standard was published in 2005[1] and revised twice[2][3] since."}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const { result } = await res.json();import os, requests
res = requests.post(
"https://astraltext.com/api/v1/remove-citations",
headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
json={"input": "The standard was published in 2005[1] and revised twice[2][3] since."},
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
- Which markers does it catch?
- Bracketed numbers such as [1] and [12], runs of them, and the bracketed source markers models emit. The text between the markers is untouched.
- Will it damage code or arrays?
- Only bracketed content that looks like a citation is removed, so an array index in prose can be affected. Do not run it over source code; run it over prose.
- Does it fix the spacing left behind?
- Space left by a removed marker is collapsed, so you do not get a double space before a full stop.
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