Strip Markdown API
Remove Markdown formatting from any text and keep the words: headings, bold, links, code ticks and list markers stripped in one paste.
| Endpoint | POST https://astraltext.com/api/v1/strip-markdown |
| Auth | Bearer token, free |
| Sends | input: text |
| Returns | result: text |
| Price | Free. 1,000 calls a day, 60 a minute. |
When to call it
A model answers in Markdown whether or not you asked. When that answer is going into an SMS, a push notification, a plain-text email, a CSV cell or a search index, the asterisks and backticks are noise. Stripping in the pipeline means every destination gets text rather than markup.
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/strip-markdown \
-H "Authorization: Bearer ast_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input": "## Result\n\nThe **fix** is in `src/app.ts`, see [the notes](https://example.com).\n\n- first\n- second"}'{
"tool": "strip-markdown",
"result": "Result\n\nThe fix is in src/app.ts, see the notes.\n\n- first\n- second",
"chars": 66,
"ms": 8
}In your language
const res = await fetch("https://astraltext.com/api/v1/strip-markdown", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"input": "## Result\n\nThe **fix** is in `src/app.ts`, see [the notes](https://example.com).\n\n- first\n- second"}),
});
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/strip-markdown",
headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
json={"input": "## Result\n\nThe **fix** is in `src/app.ts`, see [the notes](https://example.com).\n\n- first\n- second"},
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
- What happens to links?
- The link text is kept and the URL is dropped, so a sentence still reads. If you need the URLs, call the extract-urls endpoint on the original first.
- Is the code inside a fence kept?
- The fence markers go and the code stays as plain lines. To keep only the code and drop the prose, use the extract-code-blocks endpoint instead.
- Does it handle tables and blockquotes?
- Yes. Table pipes and blockquote markers are removed and the cell and quote text is kept, so the content survives without the markup.
Other endpoints
- AI text cleaner API
- Remove em dashes API
- Remove invisible characters API
- Remove emoji API
- Remove line breaks API
- Remove citations 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