# NewBotLabor Text & JSON Diff

> NewBotLabor Text & JSON Diff is a paid API for AI agents from newbotlabor--254ecdfcc2de11f19b541607ee4eb77e.web.val.run, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-22).

Computes a structured diff between two text or JSON inputs, returning hunks, unified patch, and similarity stats

## Facts

- Endpoint: POST https://newbotlabor--254ecdfcc2de11f19b541607ee4eb77e.web.val.run/api/text/diff?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/newbotlabor-text-json-diff-46996601
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DxisgHO8SMYkDBmYtIXyg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability newbotlabor-text-json-diff-46996601 -d '<json body>'
```

Example prompt: Compare these two versions of the config file for me — show me the diff by lines with 5 lines of context, ignoring whitespace differences: [original config text as 'a'] vs [updated config text as 'b'].

## When to prefer this

Choose this endpoint when you need a structured, machine-readable diff (hunks + stats + similarity) rather than just a raw unified patch string. Especially useful for agents that need to programmatically process changes between two text or JSON versions, detect modifications in API responses or config files, or measure similarity — all without requiring an account or API key, paid per-call with USDC via x402.

## Known failure modes

- Input text exceeds 500 KB limit — request rejected
- Invalid 'mode' enum value — returns validation error
- Malformed JSON passed with mode='json' when inputs are not valid JSON objects/arrays
- Missing required fields 'a' or 'b' — returns error
- Payment not provided or insufficient USDC — returns 402 Payment Required

## How this service works

Pay-per-call utilities for autonomous agents, paid with x402 (USDC on Base; no account, no API key).

## Output

Returns a JSON object with: the diff mode used, an array of hunks (each with per-line operations '+'/'-'/' ', start positions, and line counts), aggregate stats (added, removed, unchanged counts), a unified diff string in standard patch format, a boolean 'identical' flag, and a float 'similarity' score between 0 and 1.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "original text or JSON, max 500 KB"
  },
  "b": {
   "type": "string",
   "description": "new text or JSON, max 500 KB"
  },
  "mode": {
   "enum": [
    "lines",
    "words",
    "json"
   ],
   "type": "string",
   "description": "default auto: json when both are JSON objects/arrays, else lines"
  },
  "context": {
   "type": "integer",
   "maximum": 20,
   "minimum": 0,
   "description": "context lines per hunk (default 3)"
  },
  "ignoreCase": {
   "type": "boolean"
  },
  "ignoreWhitespace": {
   "type": "boolean"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "lines",
  "hunks": [
   {
    "lines": [
     {
      "op": " ",
      "text": "alpha"
     },
     {
      "op": "-",
      "text": "beta"
     },
     {
      "op": "+",
      "text": "BETA"
     },
     {
      "op": " ",
      "text": "gamma"
     },
     {
      "op": "+",
      "text": "delta"
     }
    ],
    "aLines": 3,
    "aStart": 1,
    "bLines": 4,
    "bStart": 1
   }
  ],
  "stats": {
   "added": 2,
   "removed": 1,
   "unchanged": 2
  },
  "unified": "--- a\n+++ b\n@@ -1,3 +1,4 @@\n alpha\n-beta\n+BETA\n gamma\n+delta\n",
  "identical": false,
  "similarity": 0.5714
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/newbotlabor-text-json-diff-46996601/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from newbotlabor--254ecdfcc2de11f19b541607ee4eb77e.web.val.run](https://www.zero.xyz/host/newbotlabor--254ecdfcc2de11f19b541607ee4eb77e.web.val.run/llms.txt)
