# Duo Data Utilities – Text Similarity

> Duo Data Utilities – Text Similarity is a paid API for AI agents from api.duoleads.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-02).

Compare two strings and return a comprehensive suite of similarity metrics including edit distances, phonetic keys, and token-based scores in a single call.

## Facts

- Endpoint: GET https://api.duoleads.com/v1/text/similarity?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duo-data-utilities-text-similarity-610ea613
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XTgpIq7CLY5sDjmHX0AYQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability duo-data-utilities-text-similarity-610ea613
```

Example prompt: Compare the strings 'kitten' and 'sitting' and give me all the similarity scores — edit distance, Jaro-Winkler, Dice coefficient, phonetic keys, everything — with case folding applied.

## When to prefer this

Choose this endpoint when you need multiple string similarity metrics in a single call rather than computing them separately. It is ideal for record linkage, deduplication pipelines, name-matching workflows, or any scenario requiring both edit-distance and phonetic comparison simultaneously. Prefer it over rolling your own when you also need phonetic keys (Soundex, Metaphone, NYSIIS) alongside numeric similarity scores without managing multiple libraries.

## Known failure modes

- Missing required parameters 'a' or 'b' — returns 400 error
- String exceeds 512-character limit — returns 400 validation error
- Invalid fold or only parameter values — may return 400 or be silently ignored
- Payment failure (x402) — returns 402 Payment Required if USDC payment is not attached
- Network timeout for repeated rapid calls

## How this service works

Compare two strings and return every standard similarity measure in one call: Levenshtein and Damerau-Levenshtein edit distance, normalised similarity, Jaro and Jaro-Winkler, longest common subsequence, Dice coefficient on character bigrams, and the Soundex, Metaphone and NYSIIS phonetic keys of each string. Optional case folding, accent folding and whitespace normalisation before comparison.

## Output

A JSON object containing: all requested similarity scores (Levenshtein, Damerau-Levenshtein, normalised similarity, Jaro, Jaro-Winkler, LCS length, Dice coefficient), phonetic keys for each input string (Soundex, Metaphone, NYSIIS), the folded versions of both strings, and whether they are equal after folding. Also includes metadata: request ID, computation timestamp, price, and a determinism flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "maxLength": 512,
       "description": "First string, at most 512 characters."
      },
      "b": {
       "type": "string",
       "maxLength": 512,
       "description": "Second string, at most 512 characters."
      },
      "fold": {
       "type": "string",
       "default": "case",
       "maxLength": 64,
       "description": "Comma-separated folds before comparing: case, accents, space, punct. Default case."
      },
      "only": {
       "type": "string",
       "maxLength": 256,
       "description": "Comma-separated measure names to compute: levenshtein, damerau_levenshtein, normalised_similarity, jaro, jaro_winkler, lcs_length, dice, phonetic (all three keys), soundex, metaphone, nysiis. Default all."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "route",
      "version",
      "data",
      "meta"
     ],
     "properties": {
      "ok": {
       "const": true
      },
      "data": {
       "type": "object",
       "required": [
        "equal_after_fold",
        "folded"
       ],
       "properties": {
        "dice": {
         "type": "number"
        },
        "jaro": {
         "type": "number"
        },
        "folded": {
         "type": "object",
         "required": [
          "a",
          "b"
         ],
         "properties": {
          "a": {
           "type": "string"
          },
          "b": {
           "type": "string"
          }
         }
        },
        "phonetic": {
         "type": "object",
         "required": [
          "a",
          "b"
         ],
         "properties": {
          "a": {
           "type": "object",
           "properties": {
            "nysiis": {
             "type": "string"
            },
            "soundex": {
             "ty
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "dice": 0.3636363636363636,
   "jaro": 0.746031746031746,
   "folded": {
    "a": "kitten",
    "b": "sitting"
   },
   "phonetic": {
    "a": {
     "nysiis": "CATAN",
     "soundex": "K350",
     "metaphone": "KTN"
    },
    "b": {
     "nysiis": "SATANG",
     "soundex": "S352",
     "metaphone": "STNK"
    }
   },
   "lcs_length": 4,
   "levenshtein": 3,
   "jaro_winkler": 0.746031746031746,
   "equal_after_fold": false,
   "damerau_levenshtein": 3,
   "normalised_similarity": 0.5714285714285714
  },
  "meta": {
   "price_usd": "0.05",
   "disclaimer": "Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms",
   "request_id": "01K6B7Q4ZC8H3F2M9WXR5TYN0D",
   "computed_at": "2026-09-28T12:00:00.000Z",
   "deterministic": true
  },
  "route": "/v1/text/similarity",
  "version": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duo-data-utilities-text-similarity-610ea613/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.duoleads.com](https://www.zero.xyz/host/api.duoleads.com/llms.txt)
