{"uid":"cap_L-6QUr3Kg5sR1HKARPge4","slug":"levenshtein-edit-distance-normalized-similarity-5d0147ee","name":"Levenshtein Edit Distance & Normalized Similarity","description":"Levenshtein edit distance (insertions, deletions, substitutions) between two strings, plus a normalized similarity in [0,1]. Operates on Unicode code points.","url":"https://similarity.openverbs.com/v1/levenshtein","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","maxLength":20000,"description":"First string."},"b":{"type":"string","maxLength":20000,"description":"Second string."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Rc92BDOhEn6kwLTmF-o8J","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Levenshtein edit distance (insertions, deletions, substitutions) between two strings and returns a normalized similarity score in [0,1], operating on Unicode code points.","exampleAgentPrompt":"What's the Levenshtein edit distance and normalized similarity between 'algorithm' and 'altruistic'?","exampleUseCases":[{"title":"Fuzzy product name deduplication","prompt":"I have two product names from different suppliers — 'Wireless Bluetooth Headphones' and 'Wireles Bluethooth Headphones' — can you get the Levenshtein edit distance and similarity score to decide if they're likely the same product?"},{"title":"Spell-check candidate ranking","prompt":"A user typed 'recieve' and I have candidates 'receive', 'relieve', and 'retrieve' — calculate the Levenshtein similarity score between 'recieve' and each candidate so I can rank the best correction."},{"title":"User record matching in data pipeline","prompt":"Check how similar the names 'Jonathan Smith' and 'Jonathon Smyth' are using Levenshtein edit distance and give me a normalized similarity so I can decide whether to merge these two customer records."}],"resultDescription":"Returns the raw Levenshtein edit distance (an integer count of minimum insertions, deletions, and substitutions required to transform string a into string b) and a normalized similarity score in the [0,1] range, where 1.0 means identical and 0.0 means completely dissimilar. Operates correctly on full Unicode code points.","failureModes":["Missing required field 'a' or 'b' returns a validation error","String exceeding 20,000 characters is rejected","Empty string inputs may return distance equal to the length of the other string","Network timeout for very long strings near the character limit","Payment failure via x402 protocol blocks the request"],"whenToPreferThis":"Choose this endpoint when you need a character-level, order-sensitive edit distance metric that accounts for insertions, deletions, and substitutions — ideal for spell-checking, record linkage, fuzzy matching, and deduplication. Prefer Levenshtein over Jaro-Winkler when you need a simple, widely-understood distance count rather than a prefix-boosted score. Use Damerau-Levenshtein (sibling endpoint) instead if transpositions (e.g. 'teh' vs 'the') are common in your data. Use Jaccard or Sørensen-Dice if token-level or bigram overlap matters more than edit sequence.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:40:00.642Z","isFirstParty":false}