Markdown TOC
Try it interactively →POST /api/markdown-tocBuild a Markdown table of contents from your document's headings. Configurable depth, optional anchor links matching popular renderers (GitHub, etc.).
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| markdown* | string | — | Markdown source to scan. |
| maxDepth | number (1…6) | 3 | Deepest heading level to include. |
| minDepth | number (1…6) | 1 | Shallowest heading level to include. |
| slug | enum (github | hugo) | "github" | Slug algorithm. `github` matches GitHub anchors; `hugo` matches Hugo's default rules. |
| skipFirstH1 | boolean | false | When true, drop the first H1 (commonly the document title). |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the default-depth-3 example.
curl -X POST https://api.xtract.bot/api/markdown-toc \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"markdown": "# Title\n\n## Setup\n\n### Install\n\n### Configure\n\n## Usage\n\n#### Edge cases (skipped)\n"
}'