{"uid":"cap_XTgpIq7CLY5sDjmHX0AYQ","slug":"duo-data-utilities-text-similarity-610ea613","name":"Duo Data Utilities – Text Similarity","description":"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.","url":"https://api.duoleads.com/v1/text/similarity?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{"type":"string"},"metaphone":{"type":"string"}}},"b":{"type":"object","properties":{"nysiis":{"type":"string"},"soundex":{"type":"string"},"metaphone":{"type":"string"}}}}},"lcs_length":{"type":"integer"},"levenshtein":{"type":"number"},"jaro_winkler":{"type":"number"},"equal_after_fold":{"type":"boolean"},"damerau_levenshtein":{"type":"number"},"normalised_similarity":{"type":"number"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/text/similarity"},"version":{"type":"string"}}}}}}},"responseSchema":{"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"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_EN_8kTlcvWJTUw-J5tu_9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compare two strings and return a comprehensive suite of similarity metrics including edit distances, phonetic keys, and token-based scores in a single call.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Deduplicating customer name records","prompt":"I have two customer names, 'Jon Smith' and 'John Smyth' — can you run them through every similarity measure (Levenshtein, Jaro-Winkler, Soundex, Metaphone, all of it) with case and accent folding so I can decide if they're the same person?"},{"title":"Fuzzy product title matching for e-commerce","prompt":"Check how similar 'Apple iPhone 15 Pro Max 256GB' and 'Apple iPhone 15 Pro Max 256 GB' are — give me the normalised similarity score and edit distance so I can set a deduplication threshold."},{"title":"Phonetic name matching for search autocomplete","prompt":"Do 'Catherine' and 'Kathryn' sound the same according to Soundex, Metaphone, and NYSIIS? Also give me the Jaro-Winkler score between them with case folding on."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:40:00.713Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-text-similarity-610ea613"}