{"uid":"cap_rDFa6a1MginjZTi4yjZqO","slug":"fastx402-markdown-heading-tree-7925ddde","name":"FastX402 Markdown Heading Tree","description":"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.","url":"https://fastx402.tools/markdown-heading-tree?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{}}}}}}}}}}}}}}}}},"responseSchema":{"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":[]}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_H6H0CK4JBYRZAlv9PjMvE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses a Markdown document and returns its heading hierarchy as a nested tree structure with slugs, text, and levels","exampleAgentPrompt":"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\n## Getting Started\n### Installation\n## API Reference\n# Conclusion'","exampleUseCases":[{"title":"Auto-generate docs table of contents","prompt":"I have a long README.md file and I need to build a table of contents from it — can you extract all the headings as a nested outline so I can see the structure at a glance?"},{"title":"Validate document structure before publishing","prompt":"Before I publish this markdown article, can you pull out all the headings and show me the hierarchy so I can check whether the sections are organized logically?"},{"title":"Build site navigation from markdown pages","prompt":"I'm building a static site and I need to generate a sidebar navigation menu — can you extract the heading tree from this markdown page so I can use the slugs and levels to build the nav links?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T18:25:30.439Z","isFirstParty":false,"canonicalSlug":"fastx402-markdown-heading-tree-7925ddde"}