{"uid":"cap_-xXJ4WQ33tW5RxuGMvvuK","slug":"levenshtein-edit-distance-similarity-api-50a7a65f","name":"Levenshtein Edit Distance & Similarity API","description":"Calculate edit distance and normalized similarity between two strings for fuzzy matching and typo comparison.","url":"https://x402-zoo.lolagent.workers.dev/api/levenshtein","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"},"b":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7SBckRefV1nWD5xQz3hav","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the Levenshtein edit distance and normalized similarity score between two strings for fuzzy matching and typo detection.","exampleAgentPrompt":"What's the edit distance and similarity score between 'recieve' and 'receive'? I want to check if it's likely a typo.","exampleUseCases":[{"title":"Typo detection in user input","prompt":"Compare the strings 'accomodation' and 'accommodation' — what's the edit distance and how similar are they? I need to decide if it's a likely typo."},{"title":"Fuzzy name matching for deduplication","prompt":"I have two customer names: 'Johnathan Smith' and 'Jonathan Smyth' — can you calculate their Levenshtein distance and similarity so I can decide if they're the same person?"},{"title":"Search query correction scoring","prompt":"Tell me the edit distance between the search query 'javascrpit' and 'javascript' so I can determine whether to suggest a spelling correction."}],"resultDescription":"Returns the integer Levenshtein edit distance (minimum single-character edits needed to transform string a into string b) and a normalized similarity score (float between 0 and 1, where 1 means identical strings) between the two input strings.","failureModes":["Missing query parameter 'a' or 'b' returns a 400 bad request error","Empty strings may return distance of 0 or length of the non-empty string","Very long strings may increase computation time or hit length limits","Payment failure or insufficient USDC balance returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need a precise, numeric edit-distance or similarity measure between exactly two strings — ideal for typo detection, fuzzy deduplication, spell-check scoring, or any scenario requiring a normalized 0–1 similarity score. Prefer this over semantic embedding similarity when character-level edit cost matters more than semantic meaning.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T13:02:19.196Z","isFirstParty":false}