# Soundex & Fuzzy Match API
> Phonetic and fuzzy string-matching maths as an API, computed locally and deterministically. The soundex endpoint computes the American Soundex code of a word — the first letter followed by three digits that encode its consonant sounds, ignoring case and non-letters and applying the vowel-reset and adjacent-duplicate rules — so Robert and Rupert both code to R163, Smith and Smyth to S530, and the classic tricky cases Ashcraft (A261), Tymczak (T522) and Pfister (P236) come out right. The levenshtein endpoint computes the edit distance between two strings (the minimum insertions, deletions and substitutions, optionally case-sensitive) and a 0–100 % similarity, so kitten → sitting is three edits and about 57 % similar. The compare endpoint combines both: it reports whether two strings share a Soundex code (sound alike) and their Levenshtein similarity (spelled alike), and flags a likely match when the codes agree or the similarity is at least 80 %. Everything is computed locally and deterministically, so it is instant and private. Ideal for data-deduplication, CRM, fuzzy-search, autocomplete, genealogy and data-cleaning app developers, name-matching and record-linkage tools, and search software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is phonetic and edit-distance matching; for full-text search use a search API.

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

## Pricing
- **Free** (Free) — 6,100 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 61,000 calls/Mo, 6 req/s
- **Pro** ($15/Mo) — 285,000 calls/Mo, 15 req/s
- **Mega** ($48/Mo) — 1,490,000 calls/Mo, 40 req/s

## Endpoints

### Matching

#### `GET /v1/compare` — Combined fuzzy comparison

**Parameters:**
- `a` (query, required, string) — First string Example: `Robert`
- `b` (query, required, string) — Second string Example: `Rupert`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soundex-api/v1/compare?a=Robert&b=Rupert"
```

**Response:**
```json
{
    "data": {
        "note": "Combines Soundex (sounds alike) and Levenshtein (spelled alike). likely_match is true if the Soundex codes agree or the similarity is at least 0.8.",
        "inputs": {
            "a": "Robert",
            "b": "Rupert"
        },
        "soundex_a": "R163",
        "soundex_b": "R163",
        "similarity": 0.666667,
        "likely_match": true,
        "soundex_match": true,
        "similarity_percent": 66.6667,
        "levenshtein_distance": 2
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:12.398Z",
        "request_id": "125a7115-9b95-4aac-a588-e1de777f9e47"
    },
    "status": "ok",
    "message": "Fuzzy compare",
    "success": true
}
```

#### `GET /v1/levenshtein` — Edit distance & similarity

**Parameters:**
- `a` (query, required, string) — First string Example: `kitten`
- `b` (query, required, string) — Second string Example: `sitting`
- `case_sensitive` (query, optional, string) — true/false (default false)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soundex-api/v1/levenshtein?a=kitten&b=sitting"
```

**Response:**
```json
{
    "data": {
        "note": "Levenshtein edit distance = minimum single-character insertions, deletions or substitutions. 'kitten' → 'sitting' is 3 edits; similarity = 1 − distance/max(len).",
        "inputs": {
            "a": "kitten",
            "b": "sitting",
            "case_sensitive": false
        },
        "distance": 3,
        "similarity": 0.571429,
        "similarity_percent": 57.1429
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:12.510Z",
        "request_id": "32ced954-13db-41a3-9468-efa12a1bd810"
    },
    "status": "ok",
    "message": "Edit distance",
    "success": true
}
```

#### `GET /v1/soundex` — Soundex code

**Parameters:**
- `word` (query, required, string) — Word to encode Example: `Robert`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/soundex-api/v1/soundex?word=Robert"
```

**Response:**
```json
{
    "data": {
        "note": "American Soundex: first letter + 3 digits encoding consonant sounds. Robert and Rupert both code to R163, Smith and Smyth to S530.",
        "inputs": {
            "word": "Robert"
        },
        "soundex": "R163"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:12.632Z",
        "request_id": "c69f9ca3-71f1-4187-9406-09562812164a"
    },
    "status": "ok",
    "message": "Soundex code",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Soundex ignores case and non-letters. Levenshtein is case-insensitive unless case_sensitive=true. Useful for deduplication, fuzzy search, name matching and genealogy.",
        "service": "soundex-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/compare": "Soundex + Levenshtein comparison with a likely-match flag.",
            "GET /v1/soundex": "American Soundex code of a word.",
            "GET /v1/levenshtein": "Edit distance and similarity between two strings."
        },
        "description": "Phonetic and fuzzy string matching: Soundex code, Levenshtein edit distance, and a combined comparison."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:12.764Z",
        "request_id": "1a8cf773-123c-4cd6-bd0c-f2dcb74f0fd6"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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