Catalog/text-levenshtein

Text

Levenshtein edit distance API

Computes the Levenshtein edit distance (insert/delete/substitute) between two strings plus a length-normalized similarity ratio. Answers 'how many single-character edits separate these strings?', 'how similar are they 0-1?'.

Price$0.01per request
MethodPOST
Route/v1/text/levenshtein
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
textlevenshteinedit-distancefuzzysimilaritystring-distancetypomatching
API URLhttps://x402.hexl.dev/v1/text/levenshtein
Integration docs
Example request
{
  "a": "kitten",
  "b": "sitting"
}
Example response
{
  "distance": 3,
  "similarity": 0.571429,
  "maxLength": 7,
  "operations": "insert/delete/substitute (cost 1 each)",
  "interpretation": "3 single-character edit(s) apart"
}
Input schema
{
  "type": "object",
  "required": [
    "a",
    "b"
  ],
  "properties": {
    "a": {
      "type": "string",
      "examples": [
        "kitten"
      ]
    },
    "b": {
      "type": "string",
      "examples": [
        "sitting"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}