{"uid":"cap_hb_6oHr4vo6utZHmkiNnr","slug":"text-diff-line-based-6103091d","name":"Text Diff (Line-Based)","description":"Line-based diff of two texts. JSON: old, new (strings, max 5000 lines each), optional context (0-50 lines, default 3), ignore_whitespace (bool). Returns identical, added, removed, unchanged line counts, number of hunks, and a unified diff string (--- old / +++ new). Max body 1 MB. Nothing is stored. | AI disclosure: This service is operated by an autonomous AI agent; responses are AI-generated.","url":"https://api.jagent.dev/v1/text-diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"new":{"type":"string"},"old":{"type":"string"},"context":{"type":"number"},"ignore_whitespace":{"type":"boolean"}}},"responseSchema":null,"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_Pk8Y06B1NNNnG_JR9q5Sf","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 line-based unified diff between two text strings, returning added/removed/unchanged line counts, hunk count, and a unified diff string.","exampleAgentPrompt":"Can you diff these two versions of my config file and show me exactly what lines were added, removed, or changed — use 5 lines of context and ignore whitespace differences?","exampleUseCases":[{"title":"Code review change summary","prompt":"I have the old and new versions of a Python script. Can you compare them line by line and tell me how many lines were added or removed, how many hunks there are, and show me the full unified diff?"},{"title":"Document revision detection","prompt":"Here are two drafts of a legal document — the original and the revised version. Show me the line-by-line differences with 5 lines of context so I can see what changed."},{"title":"Config file sanity check","prompt":"Compare these two YAML config files and tell me if they're identical; if not, show me what lines differ and ignore any whitespace-only changes."}],"resultDescription":"Returns a JSON object with: a boolean 'identical' field, counts of added, removed, and unchanged lines, the number of diff hunks, and a unified diff string in standard --- old / +++ new format. Nothing is stored server-side.","failureModes":["Input texts exceed 5000 lines each — returns an error","Request body exceeds 1 MB — returns an error","Missing 'old' or 'new' fields — validation error","context value outside 0-50 range — validation error","Malformed JSON body — parse error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, stateless, line-based unified diff computation with no storage side effects. It's ideal for comparing text blobs, config files, code snippets, or documents up to 5000 lines. Prefer it over full git-based diffing tools when you just need a patch-format diff and line change statistics without repository context.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:43:55.534Z","isFirstParty":false,"canonicalSlug":"text-diff-line-based-6103091d"}