{"uid":"cap_Tffa4ay04xTMfqCILy63z","slug":"api-x402node-dev-ff876d2d","name":"Text Diff / String Comparison API","description":"Text diff, text comparison, diff two strings, line diff, word diff, character diff, file diff, text patch, unified diff format, compare strings, git diff style, text difference. Compare two texts, return added/removed/unchanged segments. Line, word, or char granularity. Accepts payment on Base or Solana — either network works.","url":"https://api.x402node.dev/text/diff","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"],"properties":{"a":{"type":"string","description":"First input (required)"},"b":{"type":"string","description":"Second input (optional)"},"mode":{"type":"string","description":"Operation mode (optional)"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.016","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.016/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.016","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.016","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-XcX8-wFEwGNDpb7Usovh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.016","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two text strings and returns added, removed, and unchanged segments at line, word, or character granularity in unified diff format","exampleAgentPrompt":"Can you diff these two paragraphs word by word and show me exactly what was added and removed? Original: 'The quick brown fox jumps over the lazy dog.' New: 'The quick red fox leaps over the sleepy cat.'","exampleUseCases":null,"resultDescription":"Returns an array of diff segments, each with a 'value' string and boolean flags 'added' and 'removed' (absent means unchanged), plus a 'mode' string indicating the granularity used, and integer counts of added_count and removed_count segments.","failureModes":["Missing one or both text inputs — returns error indicating required fields","Invalid mode value — may default to line or return validation error","Extremely large texts may time out or exceed payload limits","Payment failure (x402) — returns 402 Payment Required if USDC payment not provided"],"whenToPreferThis":"Choose this endpoint when you need a structured, machine-readable diff of two text strings with explicit added/removed/unchanged segments — especially when you need line, word, or character granularity control. Ideal for AI agents that need to programmatically process text changes rather than display a human-readable diff, or when integrating into automated content review, changelog generation, or version comparison pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:48:00.937Z","isFirstParty":false}