Levenshtein Distance
The /levenshtein endpoint allows you to calculate the Levenshtein distance between two strings. This distance represents the minimum number of operations required to transform one string into another.
gethttps://api.moxon.dev /v3/levenshtein
str1stringrequiredThe first string
str2stringrequiredThe second string
GET /v3/levenshtein?str1=example&str2=samples{
"str1": "example",
"str2": "samples",
"distance": 3
}| Field | Description |
|---|---|
str1 | The first input string |
str2 | The second input string |
distance | The Levenshtein distance between the two strings |
curl -X GET "https://api.moxon.dev/v3/levenshtein?str1=example&str2=samples"If parameters are missing or invalid, the API will return an error:
- 400
Please provide a first string (?str1={string})Thestr1parameter is missing - 400
Please provide a second string (&str2={string})Thestr2parameter is missing
The Levenshtein distance is a measure of the similarity between two strings. It counts the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. This is useful for:
- Spell checking
- DNA sequence analysis
- Fuzzy string matching
- Plagiarism detection
Last updated on April 8, 2026