{"uid":"cap_-O12ziKV28JUTmNaMFOX7","slug":"api-strale-io-35fad5d6","name":"JSON Diff Comparison","description":"Compare two JSON objects and return structured diff. Shows added, removed, and changed fields with paths and values. Algorithmic.","url":"https://api.strale.io/x402/diff-json","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["before","after"],"properties":{"after":{"description":"Modified JSON"},"before":{"description":"Original JSON"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"after":{"age":26,"name":"John","email":"john@example.com","status":"active"},"before":{"age":25,"name":"John","status":"active"}}}},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.0324,"settlement_id":"0x2d5178f21092e6c15e8e406864650adc59ac0375e621a08ea6f9821638ab371b"},"capability":"diff-json","latency_ms":0,"provenance":{"source":"algorithmic","fetched_at":"2026-06-03T23:02:27.246Z"}},"added":[{"path":"/email","value":"john@example.com"}],"changed":[{"path":"/age","new_value":26,"old_value":25}],"removed":[],"identical":false,"added_count":1,"changed_count":1,"removed_count":0}},"exampleRequest":{"after":{"age":26,"name":"John","email":"john@example.com","status":"active"},"before":{"age":25,"name":"John","status":"active"}},"tags":["x402"],"displayCostAmount":"0.0324","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.0324/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0324","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KShLGdFVlbGFcEQi9Z--o","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0324","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compare two JSON objects and return a structured diff showing added, removed, and changed fields with their paths and values","exampleAgentPrompt":"Compare these two JSON objects and show me exactly what changed — the before is {\"name\":\"Alice\",\"age\":30,\"role\":\"user\"} and the after is {\"name\":\"Alice\",\"age\":31,\"role\":\"admin\",\"email\":\"alice@example.com\"}.","exampleUseCases":null,"resultDescription":"A structured diff object listing all added fields (with their new values and paths), removed fields (with their old values and paths), and changed fields (with before and after values and paths) between the two input JSON objects.","failureModes":["Missing 'before' or 'after' query parameter returns an error","Non-JSON or malformed JSON inputs cause parse errors","Very large or deeply nested JSON objects may hit size limits","Invalid query parameter encoding for complex nested JSON"],"whenToPreferThis":"Use this endpoint when you need a programmatic, algorithmic diff between two JSON objects — ideal for detecting configuration drift, tracking API response changes, auditing data mutations, or building change-detection pipelines. Prefer this over text-based diff tools when you need structured, path-aware output that distinguishes added, removed, and changed fields.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:35.012Z","isFirstParty":false}