# Anagram API
> Work with anagrams. The check endpoint tells you whether two strings are anagrams of each other — by default ignoring case, spaces and punctuation, so "Dormitory" and "Dirty Room" match. The signature endpoint returns the canonical sorted-letter key for a string; two strings are anagrams exactly when their signatures are equal, which makes the signature ideal for indexing and bucketing. The group endpoint takes a list of words and groups them into their anagram sets. Perfect for word games and puzzles, dictionaries and search, and de-duplicating reordered strings. No word list needed — it is pure letter analysis. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. Distinct from spelling, similarity and dictionary APIs.

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

## Pricing
- **Free** (Free) — 1,125 calls/Mo, 2 req/s
- **Starter** ($2/Mo) — 9,650 calls/Mo, 8 req/s
- **Pro** ($22/Mo) — 147,500 calls/Mo, 20 req/s
- **Mega** ($60/Mo) — 780,000 calls/Mo, 50 req/s

## Endpoints

### Anagram

#### `GET /v1/check` — Check if two strings are anagrams

**Parameters:**
- `a` (query, required, string) — First string Example: `Dormitory`
- `b` (query, required, string) — Second string Example: `Dirty Room`
- `ignore_case` (query, optional, string) — true/false (default true)
- `ignore_spaces` (query, optional, string) — true/false (default true)
- `letters_only` (query, optional, string) — true/false (default true)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anagram-api/v1/check?a=Dormitory&b=Dirty+Room"
```

**Response:**
```json
{
    "data": {
        "a": "Dormitory",
        "b": "Dirty Room",
        "options": {
            "ignore_case": true,
            "letters_only": true,
            "ignore_spaces": true
        },
        "identical": false,
        "is_anagram": true
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:40.992Z",
        "request_id": "2ce7ac4a-9f5c-4d91-a6ac-aa246e3692b1"
    },
    "status": "ok",
    "message": "Check if two strings are anagrams",
    "success": true
}
```

#### `GET /v1/group` — Group words by anagram

**Parameters:**
- `words` (query, required, string) — JSON array or comma list Example: `listen,silent,enlist,cat,act`
- `ignore_case` (query, optional, string) — true/false (default true)
- `ignore_spaces` (query, optional, string) — true/false (default true)
- `letters_only` (query, optional, string) — true/false (default true)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anagram-api/v1/group?words=listen%2Csilent%2Cenlist%2Ccat%2Cact"
```

**Response:**
```json
{
    "data": {
        "groups": [
            {
                "members": [
                    "listen",
                    "silent",
                    "enlist"
                ],
                "signature": "eilnst"
            },
            {
                "members": [
                    "cat",
                    "act"
                ],
                "signature": "act"
            }
        ],
        "total_words": 5,
        "anagram_groups": 2
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:41.088Z",
        "request_id": "4f19f153-7341-435a-9df1-0336b4a3bf70"
    },
    "status": "ok",
    "message": "Group words by anagram",
    "success": true
}
```

#### `GET /v1/signature` — Anagram signature

**Parameters:**
- `text` (query, required, string) — A string Example: `listen`
- `ignore_case` (query, optional, string) — true/false (default true)
- `ignore_spaces` (query, optional, string) — true/false (default true)
- `letters_only` (query, optional, string) — true/false (default true)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/anagram-api/v1/signature?text=listen"
```

**Response:**
```json
{
    "data": {
        "text": "listen",
        "signature": "eilnst"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:41.191Z",
        "request_id": "7a4604f2-c5ff-4d38-a880-15edd191e500"
    },
    "status": "ok",
    "message": "Anagram signature",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "Anagram API",
        "notes": "Two words with the same signature are anagrams. By default comparison ignores case, whitespace and punctuation. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/check",
                "params": {
                    "a": "first string (required)",
                    "b": "second string (required)",
                    "ignore_case": "default true",
                    "letters_only": "default true",
                    "ignore_spaces": "default true"
                },
                "returns": "whether they are anagrams"
            },
            {
                "path": "/v1/signature",
                "params": {
                    "text": "a string (required)"
                },
                "returns": "the canonical anagram signature"
            },
            {
                "path": "/v1/group",
                "params": {
                    "words": "JSON array or comma list (required)"
                },
                "returns": "words grouped by anagram"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Check whether two strings are anagrams, compute an anagram signature (the canonical sorted-letter key used to group anagrams), and group a list of words by their anagrams. Options to ignore ca
…(truncated, see openapi.json for full schema)
```


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