{"uid":"cap_CknlxcTEUOunEHfCoIMtE","slug":"text-diff-846392d3","name":"text-diff","description":"Unified line diff between two texts, plus an overall similarity ratio (0-1).","url":"https://x402.agentindex.world/text/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","title":"A"},"b":{"type":"string","title":"B"}}},"responseSchema":{"type":"json","example":{"diff":["--- ","+++ ","@@ -1,2 +1,2 @@"," line one","-line two","+line three"],"similarity":0.8333}},"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_mx7sA992R3tnEqaCsJN8v","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":"Computes a unified line diff between two text strings and returns an overall similarity ratio between 0 and 1.","exampleAgentPrompt":"Show me the line-by-line diff between these two paragraphs and tell me how similar they are: 'The quick brown fox jumps over the lazy dog.' vs 'The quick brown fox leapt over a lazy dog.'","exampleUseCases":[{"title":"Detect edits in contract drafts","prompt":"Compare these two contract clauses and show me exactly what lines changed and how similar they are overall: [original clause] vs [revised clause]."},{"title":"Check plagiarism similarity score","prompt":"I have a student submission and the original source text — can you diff them line by line and give me a similarity ratio so I can see how much was copied?"},{"title":"Validate config file changes","prompt":"Here's my old nginx config and the new one — show me the unified diff so I can review what changed before I deploy."}],"resultDescription":"Returns a unified line diff (showing added, removed, and context lines) between text A and text B, along with a floating-point similarity ratio between 0 (completely different) and 1 (identical).","failureModes":["Missing 'a' or 'b' parameter returns an error","Very large text inputs may hit size limits or increase latency","Both texts identical returns empty diff with similarity ratio of 1.0","Non-string inputs may cause parsing errors"],"whenToPreferThis":"Use this endpoint when you need a structured, line-level diff and a quantitative similarity score between two text strings. It is ideal for document versioning, plagiarism detection, config auditing, or any scenario where you need both human-readable change output and a machine-readable similarity metric in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-02T06:37:43.802Z","isFirstParty":false,"canonicalSlug":"text-diff-846392d3"}