# BBCode API
> Render BBCode — the [b]…[/b] markup used by forums, bulletin boards, game communities and many comment systems — into clean HTML, or strip it down to plain text. Supports bold, italic, underline, strikethrough, lists, quotes, code blocks, links, images, colour and size. Dangerous URL schemes (javascript:, data:, vbscript:) in links and images are neutralised, so the HTML is safe to display. The to-text endpoint removes all markup for previews, search indexes, notifications and excerpts. Powered by the bbob parser. Pure local computation — no key, no third-party service, instant; send large posts via POST. Live, nothing stored. 3 endpoints. Distinct from Markdown rendering and HTML-to-Markdown 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/bbcode-api/..."
```

## Pricing
- **Free** (Free) — 760 calls/Mo, 2 req/s
- **Starter** ($1/Mo) — 6,100 calls/Mo, 8 req/s
- **Pro** ($19/Mo) — 125,000 calls/Mo, 20 req/s
- **Mega** ($55/Mo) — 645,000 calls/Mo, 50 req/s

## Endpoints

### BBCode

#### `GET /v1/to-html` — Render BBCode to HTML

**Parameters:**
- `bbcode` (query, required, string) — BBCode markup Example: `[b]Hello[/b] [url=https://oanor.com]oanor[/url] [i]world[/i]`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bbcode-api/v1/to-html?bbcode=%5Bb%5DHello%5B%2Fb%5D+%5Burl%3Dhttps%3A%2F%2Foanor.com%5Doanor%5B%2Furl%5D+%5Bi%5Dworld%5B%2Fi%5D"
```

**Response:**
```json
{
    "data": {
        "html": "<span style=\"font-weight: bold;\">Hello</span> <a href=\"https://oanor.com\">oanor</a> <span style=\"font-style: italic;\">world</span>"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:49.939Z",
        "request_id": "c3b26232-85ef-4fc1-a1b8-3abc5d88ddb7"
    },
    "status": "ok",
    "message": "BBCode to HTML",
    "success": true
}
```

#### `GET /v1/to-text` — Strip BBCode to plain text

**Parameters:**
- `bbcode` (query, required, string) — BBCode markup Example: `[b]Hello[/b] [url=https://oanor.com]oanor[/url] [i]world[/i]`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bbcode-api/v1/to-text?bbcode=%5Bb%5DHello%5B%2Fb%5D+%5Burl%3Dhttps%3A%2F%2Foanor.com%5Doanor%5B%2Furl%5D+%5Bi%5Dworld%5B%2Fi%5D"
```

**Response:**
```json
{
    "data": {
        "text": "Hello oanor world"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:50.042Z",
        "request_id": "9389b7aa-adb1-4720-8e79-ac4327c765e0"
    },
    "status": "ok",
    "message": "BBCode to plain text",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "BBCode API",
        "notes": "javascript:, data: and vbscript: URLs in links/images are neutralised. Send large input via POST. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/to-html",
                "params": {
                    "bbcode": "BBCode markup (required)"
                },
                "returns": "rendered HTML (dangerous URL schemes neutralised)"
            },
            {
                "path": "/v1/to-text",
                "params": {
                    "bbcode": "BBCode markup (required)"
                },
                "returns": "plain text with tags removed"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Convert BBCode — the [b]…[/b] markup used by forums, bulletin boards and many comment systems — into safe HTML, or strip it down to plain text. Supports bold, italic, underline, strikethrough, lists, quotes, code, url, img, color and size tags. Powered by bbob. Pure local, no key."
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:50.138Z",
        "request_id": "2dd59f97-bf42-4518-b0d8-01f910751048"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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