# 402utils CSV Diff

> 402utils CSV Diff is a paid API for AI agents from 402utils.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Computes a row-level diff between two CSV files, identifying added, removed, and changed rows (with per-field old→new details when a key column is provided).

## Facts

- Endpoint: POST https://402utils.com/v1/csv-diff
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-csv-diff-f4983a7a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oM561PWj4_T1AOY4w2Iii

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 402utils-csv-diff-f4983a7a -d '<json body>'
```

Example prompt: Compare these two CSV exports and tell me which rows were added, removed, or changed — use the 'account_id' column as the key so you can match rows across both files.

## When to prefer this

Use this endpoint when you need to reconcile two CSV exports or snapshots and want to know exactly which rows were added, removed, or changed (with per-field granularity). It is especially useful for data audit trails, ETL validation, billing reconciliation, and incremental change detection between periodic exports. Prefer it over manual diffing or generic text diff tools when your data is tabular and you need structured, actionable change buckets rather than raw line diffs.

## Known failure modes

- Input CSV exceeds 5 MB — returns an error rejecting oversized input
- Key column name not found in header row — returns column-not-found error
- Malformed CSV that cannot be parsed — returns parse error
- Both CSVs have no rows — returns empty diff buckets
- Result buckets hit 10,000-row cap — diff is truncated with a warning

## How this service works

Row-level diff of two CSVs (a→b) — reconcile two exports. With `key` (a column name, or a column index when header:false), rows pair by key → added / removed / changed (per-field old→new). Without a key, a whole-row multiset diff gives added/removed only. Delimiter auto-detected (, ; tab |); tolerant RFC-4180 parsing. First row is the header unless header:false. Max 5 MB per input; reported buckets cap at 10000.

## Output

Returns bucketed diff results: lists of added rows (in b but not a), removed rows (in a but not b), and changed rows (present in both but with differing field values, showing old→new per field). Buckets are capped at 10,000 entries each. When no key is provided, only added/removed buckets are returned using whole-row multiset comparison.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "Original CSV (max 5 MB UTF-8)."
  },
  "b": {
   "type": "string",
   "description": "New CSV (max 5 MB UTF-8)."
  },
  "key": {
   "type": "string",
   "description": "Column name (header mode) or column index like \"0\" (header:false) to pair rows by. Omit for a keyless whole-row diff."
  },
  "header": {
   "type": "boolean",
   "default": true,
   "description": "Treat the first row as a header. When false, rows are arrays and key is an index."
  }
 }
}
```

## More

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