{
  "x402Version": 2,
  "id": 5903,
  "slug": "5903",
  "resource": "https://402utils.com/v1/diff",
  "description": "Compute the diff between two texts (a → b) — no git needed. Returns a standard unified patch (line-oriented in both modes, applies with git apply or patch), added/removed counts, and in word mode a token-level change list for inline highlighting (capped at 2000 entries). CRLF line endings and missing trailing newlines are preserved byte-exactly. Caps: 1 MB UTF-8 per input; pathologically divergent inputs return 422 diff_too_complex.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xc55A2D530b53CBaD1001e4AfD4720B7E71f9C291",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "2000",
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "a": "name: farm\nprice: 1 USDC\n",
            "b": "name: farm\nprice: 2 USDC\n"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "identical": false,
            "mode": "line",
            "patch": "===================================================================\n--- a\n+++ b\n@@ -1,2 +1,2 @@\n name: farm\n-price: 1 USDC\n+price: 2 USDC\n",
            "stats": {
              "added": 1,
              "removed": 1
            }
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "description": "Two texts to compare, byte-exactly (no line-ending normalization).",
                "properties": {
                  "a": {
                    "description": "Original text. Max 1 MB UTF-8.",
                    "type": "string"
                  },
                  "b": {
                    "description": "New text. Max 1 MB UTF-8.",
                    "type": "string"
                  },
                  "context": {
                    "description": "Unchanged context lines around each patch hunk. Default 3.",
                    "maximum": 10,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "mode": {
                    "description": "Granularity of stats/changes. The patch is always a line-oriented unified diff. Default \"line\".",
                    "enum": [
                      "line",
                      "word"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "a",
                  "b"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "description": "Unified patch plus change statistics.",
                "properties": {
                  "changes": {
                    "description": "Word mode only (omitted when identical): token runs in order, capped at 2000 entries. Unchanged runs have added=removed=false.",
                    "items": {
                      "properties": {
                        "added": {
                          "type": "boolean"
                        },
                        "removed": {
                          "type": "boolean"
                        },
                        "value": {
                          "description": "Text of the run.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "value",
                        "added",
                        "removed"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "identical": {
                    "description": "True when a and b are identical; patch is then empty.",
                    "type": "boolean"
                  },
                  "mode": {
                    "description": "Echo of the requested mode.",
                    "enum": [
                      "line",
                      "word"
                    ],
                    "type": "string"
                  },
                  "patch": {
                    "description": "Unified diff patch (--- a / +++ b headers). Line-oriented in both modes; empty when identical.",
                    "type": "string"
                  },
                  "stats": {
                    "description": "Counts in lines (mode line) or words (mode word).",
                    "properties": {
                      "added": {
                        "description": "Lines/words added in b.",
                        "type": "integer"
                      },
                      "removed": {
                        "description": "Lines/words removed from a.",
                        "type": "integer"
                      }
                    },
                    "required": [
                      "added",
                      "removed"
                    ],
                    "type": "object"
                  },
                  "truncated": {
                    "description": "Word mode only: true when `changes` was capped at 2000 entries.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "identical",
                  "patch",
                  "stats",
                  "mode"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "402utils.com",
  "lastUpdated": "2026-09-18T11:20:10.178Z",
  "quality": {
    "calls30d": 1,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-09-18T11:20:09.971Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "402utils.com",
    "manifest_name": "402utils.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}