Text Diff
text_diffDiff two texts: unified line diff byte-compatible with GNU diff -u (hunks, context, "No newline at end of file"), or word-level / character-level diff with [-removed-]{+added+} inline markup and merged ops. Myers shortest edit script with a patience fallback for very different inputs; options to ignore whitespace, case and CRLF/LF. Returns added/removed/unchanged counts and a similarity ratio. Offline; 20,000 lines or tokens per text. Price: $0.005 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/text-diff
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | Original text (aliases: old, before) | |
| b | Yes | New text (aliases: new, after) | |
| mode | No | unified (default, alias line), word or char | |
| a_label | No | Label for the --- header (default a) | |
| b_label | No | Label for the +++ header (default b) | |
| context | No | Context lines for unified mode, 0-20 (default 3) | |
| ignore_eol | No | Treat CRLF and LF as equal (default true) | |
| ignore_case | No | Case-insensitive comparison | |
| ignore_whitespace | No | Treat runs of whitespace as equal |