# Text Similarity String and text comparison: edit distance, Jaro-Winkler, LCS, n-gram, cosine, Soundex, Metaphone, diff and fuzzy ranking. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://text-similarity.x402tookit.com/openapi.json - x402 manifest: https://text-similarity.x402tookit.com/.well-known/x402 - Catalog (free): https://text-similarity.x402tookit.com/catalog - Health (free): https://text-similarity.x402tookit.com/health - Uptime (free): https://text-similarity.x402tookit.com/uptime ## Endpoints (10) ### GET /cosine-tokens — $0.02 Cosine similarity of the word-count vectors of two texts, with shared terms and vector norms. Params: a: string, b: string, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/cosine-tokens?a=the+cat+sat&b=the+cat+sat+on+the+mat ### GET /edit-distance — $0.02 Levenshtein and Damerau-Levenshtein edit distance (restricted and unrestricted) between two texts, with a 0 to 1 similarity. Params: a: string, b: string, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/edit-distance?a=kitten&b=sitting ### GET /fuzzy-rank — $0.02 Rank up to 50 candidates against a query by Jaro-Winkler, Levenshtein, Dice or cosine, best first, with scores. Params: query: string, candidates: string, scorer?: string, limit?: integer, minScore?: number, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/fuzzy-rank?query=jon+smith&candidates=John+Smith%7CJon+Smythe%7CJoan+Smart%7CMary+Jones&scorer=jaro-winkler ### GET /hamming — $0.02 Hamming distance between two equal-length strings (text or binary), with the differing positions. Unequal lengths are undefined. Params: a: string, b: string, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/hamming?a=karolin&b=kathrin ### GET /jaro-winkler — $0.02 Jaro and Jaro-Winkler similarity of two short strings (names), with matches, transpositions and prefix boost. Params: a: string, b: string, ignoreCase?: boolean, prefixScale?: number Example: https://text-similarity.x402tookit.com/jaro-winkler?a=MARTHA&b=MARHTA ### GET /lcs — $0.02 Longest common subsequence and longest common substring of two texts, with their lengths and a 0 to 1 ratio. Params: a: string, b: string, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/lcs?a=AGGTAB&b=GXTXAYB ### GET /metaphone — $0.02 Original Metaphone (Philips 1990, not Double) phonetic key of an English word, with optional second word to compare. Params: word: string, other?: string Example: https://text-similarity.x402tookit.com/metaphone?word=Knight&other=Night ### GET /ngram-overlap — $0.02 Dice and Jaccard n-gram overlap of two texts by character or word, as sets and as multisets. Params: a: string, b: string, n?: integer, unit?: string, ignoreCase?: boolean Example: https://text-similarity.x402tookit.com/ngram-overlap?a=night&b=nacht&n=2 ### GET /soundex — $0.02 American Soundex code of a name (R163 for Robert), with an optional second name to test whether they sound alike. Params: name: string, other?: string, variant?: string Example: https://text-similarity.x402tookit.com/soundex?name=Robert&other=Rupert ### GET /text-diff — $0.02 Diff of two short texts into equal, deleted and inserted lines or words, with counts and a similarity ratio. Params: a: string, b: string, unit?: string Example: https://text-similarity.x402tookit.com/text-diff?a=the+quick+brown+fox&b=the+quick+red+fox+jumps&unit=word ## Terms String comparison computed locally from the text the caller sends, using the published algorithms named in each answer. Scores measure surface similarity of characters or words, not meaning, and phonetic keys are English-oriented heuristics. A high score is not proof two things are the same person, company or document. Inputs are capped; compared by Unicode code point. Not legal, identity or investment advice.