# Markdown Table of Contents Extractor

> Markdown Table of Contents Extractor is a paid API for AI agents from markdown.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Extracts a heading outline from Markdown source, returning each heading's depth, text, and a GitHub-style anchor slug, with optional maximum depth filtering.

## Facts

- Endpoint: POST https://markdown.openverbs.com/v1/toc
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/markdown-table-of-contents-extractor-445c4feb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NHnBEX8JvZazOnmeZV6HR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability markdown-table-of-contents-extractor-445c4feb -d '<json body>'
```

Example prompt: Can you pull the full heading outline from this markdown file, including depth and anchor slugs for each heading, up to H3 level only?

## When to prefer this

Choose this endpoint when you need structured heading metadata — depth, text, and anchor slugs — from Markdown content, especially when building navigation, generating links to sections, or auditing document structure. Prefer over generic Markdown renderers when you only need the heading outline without full HTML output.

## Known failure modes

- Missing required 'markdown' field returns a validation error
- Markdown content exceeding 500,000 characters is rejected
- Invalid maxDepth value outside 1–6 range returns a validation error
- Malformed JSON body returns a parse error
- Empty markdown string returns an empty heading list

## How this service works

Extract the heading outline from Markdown — depth, text and a unique GitHub-style anchor slug for each heading. Optionally limit to a maximum heading depth.

## Output

An ordered list of heading objects, each containing the heading level (depth 1–6), the heading text, and a unique GitHub-style anchor slug derived from the text. Optionally limited to headings up to the specified maxDepth.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "markdown"
     ],
     "properties": {
      "markdown": {
       "type": "string",
       "maxLength": 500000,
       "description": "Markdown source."
      },
      "maxDepth": {
       "type": "integer",
       "maximum": 6,
       "minimum": 1,
       "description": "Deepest heading level to include. Default 6."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/markdown-table-of-contents-extractor-445c4feb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from markdown.openverbs.com](https://www.zero.xyz/host/markdown.openverbs.com/llms.txt)
