{"uid":"cap_1FBqeE9oTOWwwHx6Ttft_","slug":"saylor-innovations-text-diff-b712c5d2","name":"Saylor Innovations Text Diff","description":"Text diff - line-by-line differences between two texts with added, removed and unchanged counts and similarity","url":"https://saylorinnovations.com/api/tools/diff?utm_source=zero.xyz","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":"Original text"},"b":{"type":"string","description":"Changed text (each max 300 lines)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["identical","lines_added","lines_removed"],"properties":{"changes":{"type":"array","items":{"type":"object","properties":{"line":{"type":"string","description":"Line number or text of the line"},"type":{"type":"string","description":"Type or kind"},"a_line":{"type":"number","description":"A line"},"b_line":{"type":"number","description":"B line"}}}},"identical":{"type":"boolean"},"truncated":{"type":["boolean","null"],"description":"True when the list was cut at the limit"},"checked_at":{"type":["string","null"],"description":"Time the check was run (UTC)"},"similarity":{"type":"number"},"lines_added":{"type":"number","description":"Lines added"},"lines_removed":{"type":"number","description":"Lines removed"},"lines_unchanged":{"type":"number","description":"Lines unchanged"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_m50EX6IfBV84V1m22dRPU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns line-by-line differences between two texts, including added, removed, and unchanged line counts and a similarity score","exampleAgentPrompt":"Can you diff these two paragraphs for me and tell me how many lines were added, removed, and unchanged, plus a similarity score? Original: 'The quick brown fox jumps over the lazy dog. It was a sunny day.' Changed: 'The quick brown fox leaps over the lazy cat. It was a rainy day.'","exampleUseCases":[{"title":"Detect edits in a revised document","prompt":"I have two versions of a policy document — the original and the updated one. Can you do a line-by-line diff and tell me exactly which lines were added or removed, how many changed overall, and how similar the two versions are?"},{"title":"Code review change detection","prompt":"Compare these two versions of a Python function for me and show me what lines were added, removed, or stayed the same, plus give me a similarity percentage between the two."},{"title":"Plagiarism and paraphrase check","prompt":"I want to know how similar these two paragraphs are — can you diff them line by line and tell me the similarity score and whether any lines are identical?"}],"resultDescription":"Returns a JSON object with an array of line-level changes (each with line number, type, and line references for both texts), boolean flags for whether the texts are identical and whether the result was truncated, a similarity score (0–1), and counts of lines added, removed, and unchanged. Also includes a checked_at timestamp.","failureModes":["Missing required query parameters 'a' or 'b' returns an error","Texts exceeding 300 lines each may be truncated (truncated: true in response)","Empty string inputs may return identical:true with zero changes","Very long lines may affect processing or response size","Payment failure or insufficient USDC balance returns 402"],"whenToPreferThis":"Use this endpoint when you need a structured, machine-readable line-by-line diff with similarity scoring between two plain text inputs — ideal for agents that need to programmatically detect what changed between document versions, code snippets, or any two strings without spinning up a local diff library. Prefer this over general text comparison when you need explicit counts of added/removed/unchanged lines and a numeric similarity score returned as JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:08:04.552Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-text-diff-b712c5d2"}