String similarity: Levenshtein, Jaro-Winkler distance and Soundex/Metaphone phonetic keys
String similarity: compare two strings and return every standard 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 (data): levenshtein, damerau_levenshtein, normalised_similarity (0-1), jaro, jaro_winkler, lcs_length, dice, phonetic {a: {soundex, metaphone, nysiis}, b: {...}} (Soundex, Metaphone and NYSIIS are computed exactly as the jellyfish library does, on the folded string; with only=soundex|metaphone|nysiis just that key), equal_after_fold, folded {a, b}.
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#text-similarity
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/text/similarity
- Auth: none declared
Query parameters
First string, at most 512 characters. Accepted: at most 512 characters.
Second string, at most 512 characters. Accepted: at most 512 characters.
Comma-separated folds before comparing: case, accents, space, punct. Default case. Accepted: comma-separated subset of case, accents, space, punct.
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. Accepted: comma-separated subset of levenshtein, damerau_levenshtein, normalised_similarity, jaro, jaro_winkler, lcs_length, dice, phonetic, soundex, metaphone, nysiis.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.