# Unicode API
> The Unicode Character Database (UCD) as an API. Resolve ANY codepoint (0..10FFFF, including the CJK and Hangul ranges) to its name, general category, block and script — plus the literal character, HTML entity (&#x1F600;), CSS escape and UTF-8/UTF-16 byte sequences. Pass a hex codepoint (e.g. 1F600 → 😀 GRINNING FACE) or a literal character (?char=€). Search 40,000+ named characters by name (e.g. "heart", "arrow"), filter by category or block, and browse all 346 Unicode blocks. Ideal for text-processing tools, emoji pickers, editors, internationalization and developer utilities.

## 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/unicode-api/..."
```

## Pricing
- **Free** (Free) — 8,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 80,000 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 400,000 calls/Mo, 20 req/s
- **Mega** ($34/Mo) — 2,000,000 calls/Mo, 50 req/s

## Endpoints

### Unicode

#### `GET /v1/block` — A block (range + sample) or list all blocks

**Parameters:**
- `name` (query, optional, string) — Block name, e.g. Emoticons (omit to list all) Example: `Emoticons`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unicode-api/v1/block?name=Emoticons"
```

**Response:**
```json
{
    "data": {
        "last": "U+1F64F",
        "name": "Emoticons",
        "size": 80,
        "first": "U+1F600",
        "sample": [
            {
                "cp": 128512,
                "char": "😀",
                "name": "GRINNING FACE",
                "category": "So",
                "codepoint": "U+1F600"
            },
            {
                "cp": 128513,
                "char": "😁",
                "name": "GRINNING FACE WITH SMILING EYES",
                "category": "So",
                "codepoint": "U+1F601"
            },
            {
                "cp": 128514,
                "char": "😂",
                "name": "FACE WITH TEARS OF JOY",
                "category": "So",
                "codepoint": "U+1F602"
            },
            {
                "cp": 128515,
                "char": "😃",
                "name": "SMILING FACE WITH OPEN MOUTH",
                "category": "So",
                "codepoint": "U+1F603"
            },
            {
                "cp": 128516,
                "char": "😄",
                "name": "SMILING FACE WITH OPEN MOUTH AND SMILING EYES",
                "category": "So",
                "codepoint": "U+1F604"
            },
            {
                "cp": 128517,
                "char": "😅",
                "name": "SMILING FACE WITH OPEN MOUTH AND COLD SWEAT",
                "category": "So",
                "codepoint": "U+1F605"
            },
            {
            
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/char` — Resolve a codepoint or a literal character

**Parameters:**
- `cp` (query, optional, string) — Hex codepoint, e.g. 1F600 (accepts U+1F600 / 0x1F600) Example: `1F600`
- `char` (query, optional, string) — A literal character, e.g. € (alternative to cp)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unicode-api/v1/char?cp=1F600"
```

**Response:**
```json
{
    "data": {
        "cp": 128512,
        "char": "😀",
        "name": "GRINNING FACE",
        "utf8": [
            "F0",
            "9F",
            "98",
            "80"
        ],
        "block": "Emoticons",
        "utf16": [
            "D83D",
            "DE00"
        ],
        "script": "Common",
        "assigned": true,
        "category": "So",
        "codepoint": "U+1F600",
        "css_escape": "\\1F600",
        "html_entity": "&#x1F600;",
        "html_decimal": "&#128512;",
        "category_name": "Other Symbol"
    },
    "meta": {
        "timestamp": "2026-05-31T04:30:16.806Z",
        "request_id": "8c8f0d7a-92c4-4e36-ba90-dbaa1128466e"
    },
    "status": "ok",
    "message": "Character resolved",
    "success": true
}
```

#### `GET /v1/search` — Search named characters by name

**Parameters:**
- `q` (query, required, string) — Name search, e.g. heart Example: `heart`
- `category` (query, optional, string) — General category code, e.g. So, Lu, Sc
- `block` (query, optional, string) — Exact block name
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unicode-api/v1/search?q=heart&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "query": "heart",
        "total": 52,
        "offset": 0,
        "filters": {
            "block": null,
            "category": null
        },
        "results": [
            {
                "cp": 9753,
                "char": "☙",
                "name": "REVERSED ROTATED FLORAL HEART BULLET",
                "category": "So",
                "codepoint": "U+2619"
            },
            {
                "cp": 9825,
                "char": "♡",
                "name": "WHITE HEART SUIT",
                "category": "So",
                "codepoint": "U+2661"
            },
            {
                "cp": 9829,
                "char": "♥",
                "name": "BLACK HEART SUIT",
                "category": "So",
                "codepoint": "U+2665"
            },
            {
                "cp": 10083,
                "char": "❣",
                "name": "HEAVY HEART EXCLAMATION MARK ORNAMENT",
                "category": "So",
                "codepoint": "U+2763"
            },
            {
                "cp": 10084,
                "char": "❤",
                "name": "HEAVY BLACK HEART",
                "category": "So",
                "codepoint": "U+2764"
            },
            {
                "cp": 10085,
                "char": "❥",
                "name": "ROTATED HEAVY BLACK HEART BULLET",
                "category": "So",
                "codepoint": "U+2
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Version, totals & category labels

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

**Response:**
```json
{
    "data": {
        "note": "/v1/char resolves any codepoint 0..10FFFF (incl. CJK/Hangul ranges); /v1/search covers the named characters.",
        "blocks": 346,
        "fields": [
            "codepoint",
            "cp",
            "char",
            "name",
            "category",
            "category_name",
            "block",
            "script",
            "html_entity",
            "html_decimal",
            "css_escape",
            "utf8",
            "utf16"
        ],
        "ranges": 20,
        "source": "Unicode Character Database (UCD)",
        "version": "latest",
        "categories": [
            {
                "code": "Lu",
                "label": "Uppercase Letter"
            },
            {
                "code": "Ll",
                "label": "Lowercase Letter"
            },
            {
                "code": "Lt",
                "label": "Titlecase Letter"
            },
            {
                "code": "Lm",
                "label": "Modifier Letter"
            },
            {
                "code": "Lo",
                "label": "Other Letter"
            },
            {
                "code": "Mn",
                "label": "Nonspacing Mark"
            },
            {
                "code": "Mc",
                "label": "Spacing Mark"
            },
            {
                "code": "Me",
                "label": "Enclosing Mark"
            },
            {
                "code": "Nd",
                "
…(truncated, see openapi.json for full schema)
```


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