# Front Matter API
> Read and write the front-matter metadata block at the top of Markdown and content files — the --- ... --- header used by Jekyll, Hugo, Astro, Eleventy, Gatsby, Next.js MDX and Obsidian. The parse endpoint splits a document into its structured front-matter data (title, tags, date, draft flags and anything else, as proper JSON), the body content and an optional excerpt, and tells you whether front matter was present. The stringify endpoint does the reverse: give it a JSON object of fields and a body, and it returns a clean Markdown file with a YAML front-matter block. Front matter is read as YAML (which also accepts JSON). Perfect for static-site build steps, headless-CMS imports, content migrations and validating posts. Pure local computation — no key, no third-party service, instant; send large documents via POST. Live, nothing stored. 3 endpoints. Distinct from Markdown rendering / table-of-contents extraction and from YAML/TOML format conversion.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/frontmatter-api/..."
```

## Pricing
- **Free** (Free) — 900 calls/Mo, 2 req/s
- **Starter** ($2/Mo) — 7,500 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 132,000 calls/Mo, 20 req/s
- **Mega** ($56/Mo) — 680,000 calls/Mo, 50 req/s

## Endpoints

### Front Matter

#### `GET /v1/parse` — Parse front matter from Markdown

**Parameters:**
- `markdown` (query, required, string) — File contents (--- front matter --- + body) Example: `---
title: Hello World
tags:
  - intro
  - demo
draft: false
---
# Heading

Body text.`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/frontmatter-api/v1/parse?markdown=---%0Atitle%3A+Hello+World%0Atags%3A%0A++-+intro%0A++-+demo%0Adraft%3A+false%0A---%0A%23+Heading%0A%0ABody+text."
```

**Response:**
```json
{
    "data": {
        "data": {
            "tags": [
                "intro",
                "demo"
            ],
            "draft": false,
            "title": "Hello World"
        },
        "content": "# Heading\n\nBody text.",
        "excerpt": "",
        "is_empty": false,
        "language": "yaml"
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:46.115Z",
        "request_id": "b64d3cb5-6098-4e71-941a-0114b536302d"
    },
    "status": "ok",
    "message": "Parse front matter",
    "success": true
}
```

#### `GET /v1/stringify` — Build Markdown with front matter

**Parameters:**
- `data` (query, required, string) — JSON object of fields Example: `{"title":"Hello","draft":false}`
- `content` (query, optional, string) — Body text Example: `Body here`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/frontmatter-api/v1/stringify?data=%7B%22title%22%3A%22Hello%22%2C%22draft%22%3Afalse%7D&content=Body+here"
```

**Response:**
```json
{
    "data": {
        "markdown": "---\ntitle: Hello\ndraft: false\n---\nBody here\n"
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:46.229Z",
        "request_id": "7dd073d3-456b-4d54-818c-7ce0d913c096"
    },
    "status": "ok",
    "message": "Build front matter",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/frontmatter-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Front Matter API",
        "notes": "Front matter is read as YAML (a superset that also accepts JSON). Send large documents via POST. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/parse",
                "params": {
                    "markdown": "the file contents (required)"
                },
                "returns": "data (front matter), content (body), excerpt, is_empty, language"
            },
            {
                "path": "/v1/stringify",
                "params": {
                    "data": "JSON object of front-matter fields (required)",
                    "content": "the body (optional)"
                },
                "returns": "a Markdown string with a YAML front-matter block"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Parse and write YAML/JSON front matter in Markdown and content files — the --- ... --- metadata block used by Jekyll, Hugo, Astro, Eleventy, Gatsby and Obsidian. Powered by gray-matter. Pure local, no key."
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:46.331Z",
        "request_id": "2a35ba9a-570a-47f9-9df2-71c2ae2c136f"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/frontmatter-api
OpenAPI spec: https://www.oanor.com/api/frontmatter-api/openapi.json
