Attest tools · Text and JSON compare

Compare two texts

Compare two versions of a short document line by line.

1 credit per successful call

Input JSON

{
  "a": "Linen\nStock: 3\n",
  "b": "Linen\nStock: 4\n",
  "mode": "lines"
}

Captured output JSON

{
  "mode": "lines",
  "unit": "lines",
  "identical": false,
  "stats": {
    "added": 1,
    "removed": 1,
    "unchanged": 1
  },
  "changes": [
    {
      "type": "unchanged",
      "value": "Linen\n"
    },
    {
      "type": "removed",
      "value": "Stock: 3\n"
    },
    {
      "type": "added",
      "value": "Stock: 4\n"
    }
  ],
  "truncated": false,
  "coarse": false,
  "unified_patch": "--- a\n+++ b\n@@ -1,2 +1,2 @@\n Linen\n-Stock: 3\n+Stock: 4\n",
  "patch_truncated": false,
  "options": {
    "ignore_whitespace": false,
    "ignore_case": false,
    "context_lines": 3
  },
  "checked_at": "2026-10-20T20:47:47.585Z"
}

API call

curl -s -X POST https://getattest.com.au/api/v1/diff \
  -H "authorization: Bearer $ATTEST_API_KEY" \
  -H "content-type: application/json" \
  --data-raw '{"a":"Linen\nStock: 3\n","b":"Linen\nStock: 4\n","mode":"lines"}'

Run this call with your own bearer key. Issue an API key.

About this example

The input was validated and run locally through the registered service. The output above is a display preview of the captured service result. File bytes are described instead of printed, and strings longer than 400 characters are truncated; the HTTP API also adds call_id, credits_charged and credits_remaining. Timestamps and generated identifiers will vary.

Source: apps/api/svc/text_diff.mjs

Tool reference and limits · API key guide