# APIAcre Document Diff

> APIAcre Document Diff is a paid API for AI agents from apiacre.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Generates a structured unified diff between two text inputs, highlighting additions, deletions, and unchanged lines.

## Facts

- Endpoint: POST https://apiacre.com/v1/document/diff
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/apiacre-document-diff-70bc0cfb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oRytkaJ14IbFxuYZy_BH3

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 apiacre-document-diff-70bc0cfb -d '<json body>'
```

Example prompt: 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.'

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Compare two texts and return structured line additions, removals, and a unified diff.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/apiacre-document-diff-70bc0cfb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from apiacre.com](https://www.zero.xyz/host/apiacre.com/llms.txt)
