# Markdown to HTML (`text.markdown_to_html`)

Render Markdown (headings, lists, tables, fenced code, quotes, links, bold, italics) to escaped, safe HTML with a heading outline.

- **Route:** `POST /v1/run/text.markdown_to_html`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 6 ms · p95 6 ms · p99 6 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `markdown` | string | yes |  | Markdown text |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `html` | Rendered HTML; raw HTML in the input is escaped. |
| `headings` | Outline of h2/h3 headings with their ids. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/text.markdown_to_html \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Release notes\n\n- **Faster** crawl\n- New `dns.lookup` endpoint\n\nSee [the docs](https://getallapis.com/docs)."}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('text.markdown_to_html', {'markdown': '# Release notes\n\n- **Faster** crawl\n- New `dns.lookup` endpoint\n\nSee [the docs](https://getallapis.com/docs).'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run text.markdown_to_html '{"markdown":"# Release notes\n\n- **Faster** crawl\n- New `dns.lookup` endpoint\n\nSee [the docs](https://getallapis.com/docs)."}'
```

Quote first (free, validates input): `POST /v1/quote/text.markdown_to_html` with the same body.
