{"uid":"cap_DxisgHO8SMYkDBmYtIXyg","slug":"newbotlabor-text-json-diff-46996601","name":"NewBotLabor Text & JSON Diff","description":"Pay-per-call utilities for autonomous agents, paid with x402 (USDC on Base; no account, no API key).","url":"https://newbotlabor--254ecdfcc2de11f19b541607ee4eb77e.web.val.run/api/text/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZkDkGeCsk4DBf4rSFrjXr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a structured diff between two text or JSON inputs, returning hunks, unified patch, and similarity stats","exampleAgentPrompt":"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'].","exampleUseCases":[{"title":"Detect JSON API response changes","prompt":"I have two JSON payloads — yesterday's API response and today's. Can you diff them in JSON mode and tell me which fields were added, removed, or changed?"},{"title":"Review document edits before publishing","prompt":"Here's the original draft and the revised version of my article. Show me a line-by-line diff with 3 lines of context so I can review what my editor changed."},{"title":"Validate config file modifications","prompt":"Compare these two YAML config files — the old one and the new one — using line mode and ignoring case differences. I want to see the unified patch and the similarity score."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:40:46.991Z","isFirstParty":false,"canonicalSlug":"newbotlabor-text-json-diff-46996601"}