{"uid":"cap_USJUcVj1MDVKyYao2hs6y","slug":"swift-bot-labs-text-diff-fc8bc3b1","name":"Swift Bot Labs Text Diff","description":"62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.","url":"https://x402-toolbox.swiftbotlab.workers.dev/v1/text/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","maxLength":524288},"b":{"type":"string","maxLength":524288},"context":{"type":"integer","default":3,"maximum":20,"minimum":0}}},"responseSchema":{"type":"json","example":{"ok":true,"tool":"text-diff","result":{"added":2,"hunks":1,"removed":1,"unified":"@@ -1,3 +1,4 @@\n one\n-two\n+2\n three\n+four","identical":false}}},"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_XGvh8BoUs3Ehv18p8GuIF","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":"Computes a unified text diff between two strings, returning added/removed line counts and a unified diff patch","exampleAgentPrompt":"Show me what changed between these two paragraphs — the first one starts with 'one two three' and the second with 'one 2 three four' — give me a unified diff with 3 lines of context.","exampleUseCases":[{"title":"Code review diff summary","prompt":"I have two versions of a config file — the original and the updated one. Can you compare them and show me a unified diff so I can see exactly what lines changed?"},{"title":"Document revision tracking","prompt":"Here are two drafts of a marketing email: draft 1 and draft 2. Show me all the additions and deletions between them with 5 lines of context around each change."},{"title":"Automated changelog generation","prompt":"Compare these two versions of my README and tell me how many lines were added and removed, plus give me the unified diff so I can paste it into the changelog."}],"resultDescription":"Returns a JSON object with ok=true, the tool name 'text-diff', and a result object containing: the number of lines added, lines removed, number of hunks, a unified diff string in standard patch format, and a boolean indicating whether the two inputs were identical.","failureModes":["Input strings exceed 524288 character limit — request rejected","Missing required fields 'a' or 'b' — validation error","Context value outside 0-20 range — validation error","Payment not included or insufficient USDC — 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, server-side unified diff computation between two text strings without setting up a local diffing library. It is ideal for agents that need to compare document versions, generate patch output, or check text identity programmatically, especially in serverless or sandboxed environments where running native diff tools is not possible. Pays per call in USDC via x402, so no API key management is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:40:22.101Z","isFirstParty":false,"canonicalSlug":"swift-bot-labs-text-diff-fc8bc3b1"}