{"uid":"cap_sG_bziEcp12NB4CpVVd2B","slug":"text-similarity-comparison-cosine-jaccard-41d4608b","name":"Text Similarity Comparison (Cosine & Jaccard)","description":"Compare two texts and return cosine and Jaccard similarity scores with the top shared keywords, useful for duplicate and near-duplicate detection. text similarity, string similarity, compare documents, duplicate detection, content overlap Accepts payment on Base or Solana — either network works.","url":"https://api.x402node.dev/text/similarity","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","description":"First text (required)"},"b":{"type":"string","description":"Second text (required)"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0j5DBvggpgx0fNAHX3guk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two text inputs and returns cosine similarity score, Jaccard similarity score, and top shared keywords for duplicate and near-duplicate detection.","exampleAgentPrompt":"Can you tell me how similar these two paragraphs are — both the cosine and Jaccard scores — and show me the top keywords they share? First: 'The quick brown fox jumps over the lazy dog.' Second: 'A fast brown fox leaped above a sleepy dog.'","exampleUseCases":null,"resultDescription":"Returns a JSON object with a cosine similarity score (float 0–1), a Jaccard similarity score (float 0–1), and a list of the top shared keywords found in both input texts.","failureModes":["Missing one or both text parameters returns a 400 error","Empty string inputs may return zero scores with no shared keywords","Extremely long texts may be truncated or time out","Non-UTF-8 encoded text may cause parsing errors","Identical texts return scores of 1.0 which may be misinterpreted as an error"],"whenToPreferThis":"Use this endpoint when you need a lightweight, dual-metric similarity comparison (cosine + Jaccard) with keyword evidence, especially for duplicate detection workflows, content moderation pipelines, or any scenario where you need both vector-space and set-overlap perspectives on text similarity without spinning up a full NLP stack.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:11:53.478Z","isFirstParty":false}