Skip to main content

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.

EndpointPOST https://astraltext.com/api/v1/strip-markdown
AuthBearer token, free
Sendsinput: text
Returnsresult: text
PriceFree. 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
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"}'
response
{
  "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

JavaScript
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();
Python
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

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

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

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