# TradepilotUSA Markdown Heading Outline Extractor

> TradepilotUSA Markdown Heading Outline Extractor is a paid API for AI agents from www.tradepilotusa.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-02).

Parses a Markdown document and returns a structured outline of all ATX headings (H1–H6) with their line numbers and levels.

## Facts

- Endpoint: POST https://www.tradepilotusa.com/api/agent-commerce/v1/services/markdown_heading_outline/execute?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tradepilotusa-markdown-heading-outline-extractor-f0aeadd7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8Sv66sX5Uv82qOY6vmQEV

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 tradepilotusa-markdown-heading-outline-extractor-f0aeadd7 -d '<json body>'
```

Example prompt: Can you extract all the headings from this markdown document and give me a structured outline showing each heading's level and line number? Here's the markdown: '# Introduction\n\nSome text.\n\n## Background\n\nMore text.'

## When to prefer this

Choose this endpoint when you need a fast, deterministic, zero-hallucination extraction of ATX heading structure from Markdown — no LLM involved, so results are perfectly consistent. Ideal when you need line numbers for navigation, want to validate document structure programmatically, or need to build a table of contents without any AI variance. Prefer over LLM-based parsing when accuracy and reproducibility are critical.

## Known failure modes

- Markdown input exceeds 48,000 character limit — request rejected
- Empty markdown string returns an empty headings array with heading_count 0
- Setext-style headings (underline syntax) are intentionally excluded and will not appear in results
- Headings inside fenced code blocks are excluded by design
- Malformed JSON body returns a 400-level error

## How this service works

Extract ATX headings with levels and source line numbers from Markdown, excluding fenced code blocks. Leaves inline Markdown in titles unchanged. Setext and container-nested headings are outside the supported subset.

## Output

Returns a JSON object containing: a 'headings' array where each item has 'line' (line number), 'level' (1–6), and 'title' (heading text); a 'heading_count' integer; a 'syntax' description clarifying that only ATX-style headings outside fenced code blocks are extracted; a 'utility' identifier; and a 'provenance' block confirming deterministic local execution with no model or network calls used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "markdown": {
   "type": "string",
   "maxLength": 48000
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "syntax": "ATX headings outside fenced code; inline Markdown preserved; Setext headings excluded",
   "headings": [
    {
     "line": 1,
     "level": 1,
     "title": "Overview"
    },
    {
     "line": 3,
     "level": 2,
     "title": "Delivery"
    }
   ],
   "heading_count": 2
  },
  "utility": "markdown_heading_outline",
  "provenance": {
   "execution": "deterministic_local",
   "model_used": false,
   "network_request_performed": false
  },
  "request_id": "example_markdown_heading_outline"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tradepilotusa-markdown-heading-outline-extractor-f0aeadd7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.tradepilotusa.com](https://www.zero.xyz/host/www.tradepilotusa.com/llms.txt)
