# String Similarity API
> A fast, fully-local string similarity and fuzzy-matching toolkit: edit distances (Levenshtein, Damerau-Levenshtein, Hamming), normalized 0-1 similarity scores (Levenshtein ratio, Jaro, Jaro-Winkler, Dice and Jaccard), Soundex phonetic codes, and best-match ranking of a query against a candidate list. Every endpoint accepts input via the query string or the request body. Pure server-side compute, no third-party upstream, so responses are instant and always available. Ideal for record matching and deduplication, search and autocomplete, spell-checking, data cleaning and entity resolution.

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

## Pricing
- **Free** (Free) — 16,000 calls/Mo, 3 req/s
- **Basic** ($5/Mo) — 280,000 calls/Mo, 12 req/s
- **Pro** ($15/Mo) — 1,500,000 calls/Mo, 35 req/s
- **Mega** ($40/Mo) — 7,500,000 calls/Mo, 120 req/s

## Endpoints

### Similarity

#### `GET /v1/distance` — Edit distance

**Parameters:**
- `a` (query, required, string) — First string Example: `kitten`
- `b` (query, required, string) — Second string Example: `sitting`
- `algorithm` (query, optional, string) — levenshtein, damerau, hamming Example: `levenshtein`

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

**Response:**
```json
{
    "data": {
        "a": "kitten",
        "b": "sitting",
        "distance": 3,
        "algorithm": "levenshtein"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:23.542Z",
        "request_id": "087185c4-c529-4c76-9357-8adc6465617d"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/match` — Best-match ranking

**Parameters:**
- `query` (query, required, string) — Query string Example: `appl`
- `candidates` (query, required, string) — Pipe- or comma-separated list Example: `apple|grape|maple`
- `algorithm` (query, optional, string) — Default jaro-winkler Example: `jaro-winkler`
- `limit` (query, optional, string) — Max results 1-100 Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/similarity-api/v1/match?query=appl&candidates=apple%7Cgrape%7Cmaple&algorithm=jaro-winkler&limit=10"
```

**Response:**
```json
{
    "data": {
        "query": "appl",
        "matches": [
            {
                "score": 0.96,
                "candidate": "apple"
            },
            {
                "score": 0.7833,
                "candidate": "maple"
            },
            {
                "score": 0.4833,
                "candidate": "grape"
            }
        ],
        "algorithm": "jaro-winkler",
        "best_match": "apple"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:23.611Z",
        "request_id": "38fe6518-46b6-4f36-b35b-9600f1da45a0"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/similarity` — Similarity scores

**Parameters:**
- `a` (query, required, string) — First string Example: `martha`
- `b` (query, required, string) — Second string Example: `marhta`
- `algorithm` (query, optional, string) — Omit for all: levenshtein, jaro, jaro-winkler, dice, jaccard

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/similarity-api/v1/similarity?a=martha&b=marhta"
```

**Response:**
```json
{
    "data": {
        "a": "martha",
        "b": "marhta",
        "scores": {
            "dice": 0.4,
            "jaro": 0.9444,
            "jaccard": 0.25,
            "levenshtein": 0.6667,
            "jaro_winkler": 0.9611
        }
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:23.683Z",
        "request_id": "f8f52f31-6014-48e6-a38e-56bf4f5d8892"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/soundex` — Soundex phonetic codes

**Parameters:**
- `text` (query, required, string) — One or more words Example: `Robert Rupert`

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

**Response:**
```json
{
    "data": {
        "text": "Robert Rupert",
        "codes": [
            {
                "word": "Robert",
                "soundex": "R163"
            },
            {
                "word": "Rupert",
                "soundex": "R163"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:23.750Z",
        "request_id": "67a2e0a0-d874-4768-86e5-f82d9720d652"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```


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