# FastX402 Markdown Heading Tree

> FastX402 Markdown Heading Tree is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.002/call, status down (last checked 2026-10-30).

Parses a Markdown document and returns its heading hierarchy as a nested tree structure with slugs, text, and levels

## Facts

- Endpoint: GET https://fastx402.tools/markdown-heading-tree?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: down
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-markdown-heading-tree-7925ddde
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rDFa6a1MginjZTi4yjZqO

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 fastx402-markdown-heading-tree-7925ddde
```

Example prompt: Can you parse the headings from this markdown document and give me back a nested tree showing all the sections and their hierarchy? Here's the markdown: '# Introduction
## Getting Started
### Installation
## API Reference
# Conclusion'

## When to prefer this

Choose this endpoint when you need a structured, nested heading tree from a Markdown document — especially when you need slugs for anchor links, or need to traverse the document hierarchy programmatically. It is ideal for building table-of-contents components, navigation menus, or document outlines without writing your own markdown parser. No API key required — pay $0.002 USDC per call via x402.

## Known failure modes

- Empty or missing 'markdown' query parameter returns an error
- Markdown with no headings returns an empty headings array
- Malformed markdown may produce unexpected heading extraction
- Very large markdown documents may hit query parameter length limits
- Non-markdown content passed as input may return empty or partial results

## How this service works

216 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

A JSON object containing a 'headings' array of nested heading nodes, each with 'text' (the heading content), 'level' (1–6), 'slug' (URL-safe anchor), and 'children' (an array of sub-headings at the next level down), forming a complete recursive tree of the document structure.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "markdown"
     ],
     "properties": {
      "markdown": {
       "type": "string",
       "description": "Markdown document to parse"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "headings": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "slug": {
          "type": "string"
         },
         "text": {
          "type": "string"
         },
         "level": {
          "type": "integer"
         },
         "children": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "slug": {
             "type": "string"
            },
            "text": {
             "type": "string"
            },
            "level": {
             "type": "integer"
            },
            "children": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "slug": {
                "type": "string"
               },
               "text": {
                "type": "string"
               },
               "level": {
                "type": "integer"
               },
               "children": {
                "type": "array",
                "items": {}
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "headings": [
   {
    "slug": "introduction",
    "text": "Introduction",
    "level": 1,
    "children": [
     {
      "slug": "getting-started",
      "text": "Getting Started",
      "level": 2,
      "children": [
       {
        "slug": "installation",
        "text": "Installation",
        "level": 3,
        "children": []
       },
       {
        "slug": "configuration",
        "text": "Configuration",
        "level": 3,
        "children": []
       }
      ]
     },
     {
      "slug": "api-reference",
      "text": "API Reference",
      "level": 2,
      "children": []
     }
    ]
   },
   {
    "slug": "conclusion",
    "text": "Conclusion",
    "level": 1,
    "children": []
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-markdown-heading-tree-7925ddde/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
