🔀

Text Diff

Get a structured word-level or line-level diff between two texts

POST /v1/text/diff

How to Use

1

1. Send a POST request to `/v1/text/diff` with `original` and `revised` as the two texts. 2. Set `mode` to `word` (default) or `line`. 3. Iterate over the `diff` array; render `delete` segments in red and `insert` segments in green. 4. Use `insertions` and `deletions` counts for summary statistics.

About This Tool

The Text Diff endpoint compares two texts and returns a structured list of changes — additions, deletions, and unchanged sections — at word or line granularity.

Each segment in the response has a `type` field (`equal`, `insert`, `delete`) and the corresponding `text`, making it trivial to render coloured diffs in any UI framework.

Use Cases

Document version control

Show what changed between two versions of a document

Contract comparison

Highlight clause changes between contract drafts for legal review

Content editor history

Display inline revision tracking in a CMS

Configuration auditing

Compare config file versions in plain text