# CSV Deduplication API (x402)

> CSV Deduplication API (x402) is a paid API for AI agents from x402-url-evidence.vercel.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Removes duplicate rows from a CSV string using configurable key columns, returning a deduplicated CSV with a SHA-256 hash and row counts.

## Facts

- Endpoint: POST https://x402-url-evidence.vercel.app/api/csv-dedupe
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/csv-deduplication-api-x402-7448606d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PML3KKO7QOMeLRisaw900

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 csv-deduplication-api-x402-7448606d -d '<json body>'
```

Example prompt: I have a CSV with contact records that has a lot of duplicate emails — can you deduplicate it using the 'email' column as the key, with case-insensitive matching? Here's the CSV text: 'email,name\nAlice@example.com,Alice\nalice@example.com,Alice Dup\nbob@example.com,Bob'

## When to prefer this

Choose this endpoint when you need a deterministic, auditable deduplication of CSV data with configurable key columns and case normalization, and you want a verifiable SHA-256 hash of the output for integrity checking. It is ideal for data pipeline pre-processing, contact list cleaning, or any ETL step where reproducible deduplication with a micropayment audit trail (settled in USDC on Base) is acceptable. Prefer this over in-house scripts when you need a stateless, pay-per-use deduplication service without infrastructure overhead.

## Known failure modes

- Missing or empty 'csvText' field returns a validation error
- CSV with no header row or an empty header causes a parse error
- Invalid or non-existent 'keyColumns' values that don't match any header column may result in an error or fallback to all columns
- Malformed CSV (unbalanced quotes, inconsistent columns) may cause a parse failure
- Payment failure via x402 (insufficient USDC balance) results in a 402 response before processing
- Extremely large CSV inputs may hit payload or timeout limits

## How this service works

Paid deterministic utility APIs settled in native USDC on Base.

## Output

Returns a JSON object containing: the deduplicated CSV as a string ('csv'), a SHA-256 hex hash of the output ('sha256'), the number of input rows ('inputRows'), output rows ('outputRows'), duplicates removed ('duplicatesRemoved'), and the key columns used ('keyColumns').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "csvText"
     ],
     "properties": {
      "csvText": {
       "type": "string",
       "description": "CSV text with a unique, non-empty header row"
      },
      "keyColumns": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "description": "Columns used as the duplicate key; defaults to all columns"
      },
      "trimWhitespace": {
       "type": "boolean",
       "description": "Trim duplicate-key values; defaults true"
      },
      "caseInsensitive": {
       "type": "boolean",
       "description": "Normalize duplicate keys to lowercase; defaults true"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "csv": "email,name\nALICE@example.com,Alice\n",
  "sha256": "64 lowercase hexadecimal characters",
  "inputRows": 2,
  "keyColumns": [
   "email"
  ],
  "outputRows": 1,
  "duplicatesRemoved": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/csv-deduplication-api-x402-7448606d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-url-evidence.vercel.app](https://www.zero.xyz/host/x402-url-evidence.vercel.app/llms.txt)
