{"uid":"cap_oRytkaJ14IbFxuYZy_BH3","slug":"apiacre-document-diff-70bc0cfb","name":"APIAcre Document Diff","description":"Compare two texts and return structured line additions, removals, and a unified diff.","url":"https://apiacre.com/v1/document/diff","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"after":{"type":"string","title":"After","maxLength":500000},"before":{"type":"string","title":"Before","maxLength":500000},"context_lines":{"type":"integer","title":"Context Lines","default":3,"maximum":20,"minimum":0}}},"responseSchema":{"type":"json","example":{"data":{"diff":"--- before\n+++ after\n@@ -1 +1 @@\n-status: draft\n+status: approved","added":1,"changed":true,"removed":1},"meta":{"cached":false,"sources":[],"warnings":[],"duration_ms":42,"next_actions":[]},"service":"document.diff","version":"1","request_id":"018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5TOWNJW1dpeyHmhqFOATV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates a structured unified diff between two text inputs, highlighting additions, deletions, and unchanged lines.","exampleAgentPrompt":"Can you generate a unified diff between these two versions of my README file? Here's the original: 'Hello World\\nThis is version 1.' and here's the updated version: 'Hello World\\nThis is version 2\\nWith a new line.'","exampleUseCases":[{"title":"Code review change summary","prompt":"I have two versions of a config file — the one we deployed last week and the updated one I'm about to push. Can you generate a structured unified diff so I can review exactly what lines changed before I approve it?"},{"title":"Document revision tracking","prompt":"Here's a draft contract from Monday and a revised version from today — can you produce a unified diff so our legal team can see precisely what paragraphs were added, removed, or edited?"},{"title":"Automated changelog generation","prompt":"I'm building a release pipeline and need to compare the old version of our CHANGELOG.md with the new one. Can you generate a structured diff between the two texts so I can extract just the new entries?"}],"resultDescription":"Returns a structured unified diff in standard patch format, showing hunks with context lines, lines prefixed with '+' for additions and '-' for removals, along with line number ranges for each changed block.","failureModes":["Empty or missing input texts return an error or empty diff","Extremely large texts may time out or be truncated","Binary or non-UTF-8 content may not be handled correctly","Identical texts produce an empty diff output with no hunks"],"whenToPreferThis":"Choose this endpoint when you need a programmatic, structured unified diff between two arbitrary text blobs — especially useful in agentic pipelines that need to parse change hunks, generate changelogs, or summarize edits. Prefer it over manual string comparison or custom diff logic when you want a standard patch-format output without deploying your own diff tooling.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:44:36.029Z","isFirstParty":false}