# CSV Data Cleanup & Deduplication API

> CSV Data Cleanup & Deduplication API is a paid API for AI agents from well-016-datacleanup.rainmaker-wells.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-22).

Cleans and normalizes a CSV file by trimming whitespace, standardizing dates/emails/phones, applying case rules, and merging or flagging duplicate rows, returning cleaned CSV plus a JSON summary report.

## Facts

- Endpoint: POST https://well-016-datacleanup.rainmaker-wells.workers.dev/api/data-cleanup?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/csv-data-cleanup-deduplication-api-6f906a87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S3csX2KImJsKri7PLInKx

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-data-cleanup-deduplication-api-6f906a87 -d '<json body>'
```

Example prompt: Can you clean up this CSV — trim all whitespace, convert any date columns to ISO 8601 (dates are in month/day/year order), lowercase all email addresses, normalize phone numbers to digits only, and merge any fuzzy duplicate rows matched on the 'email' and 'name' columns? Here's the file URL: https://example.com/contacts.csv

## When to prefer this

Choose this endpoint when you need deterministic, rule-based CSV cleaning without AI involvement — especially for normalizing dates, phones, emails, casing, and deduplicating rows with configurable fuzzy matching. It is ideal for pre-import ETL pipelines, contact list cleanup, and data quality checks on files up to 1 MB / 20k rows. Nothing is stored server-side, making it suitable for sensitive data. Prefer it over AI-based cleaning when reproducibility and low cost ($0.005 per call) are priorities.

## Known failure modes

- CSV exceeds 1 MB or 20,000 rows — returns an error indicating size limit exceeded
- URL is not publicly accessible or not HTTPS — returns a fetch error
- Malformed CSV that cannot be parsed — returns a parse error
- fuzzy_threshold outside 0.5–1 range — may return a validation error
- Network timeout fetching remote URL — returns a timeout error

## How this service works

Clean a CSV ($0.005 USDC): give an https url or inline csv (max 1 MB / 20k rows). Trims whitespace, optional case rules, dates to ISO 8601, lowercases emails, normalizes phone digits, merges or flags exact + fuzzy duplicate rows on key_columns. Returns cleaned CSV text + JSON report (rows in/out, dupes, columns changed). Deterministic, no AI. As is, no warranty. Nothing stored. Provided as is, with no warranty or guarantee of accuracy or fitness. Nothing is stored.

## Output

Returns cleaned CSV text with all normalizations applied (whitespace trimmed, dates in ISO 8601, emails lowercased, phone digits normalized, duplicates merged or flagged), plus a JSON report containing row counts in and out, number of duplicates found, and a list of columns that were changed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "csv": {
   "type": "string",
   "description": "Inline CSV text instead of url (max 1 MB)."
  },
  "url": {
   "type": "string",
   "description": "Public https URL of a CSV (max 1 MB)."
  },
  "fuzzy": {
   "type": "boolean",
   "description": "Also match near-duplicates (default true)."
  },
  "dedupe": {
   "type": "string",
   "description": "merge (default), flag, or none."
  },
  "case_rules": {
   "type": "object",
   "description": "Map column -> lower | upper | title."
  },
  "date_order": {
   "type": "string",
   "description": "mdy (default) or dmy for ambiguous dates."
  },
  "has_header": {
   "type": "boolean",
   "description": "First row is a header (default true)."
  },
  "key_columns": {
   "type": "array",
   "description": "Columns used to detect duplicates (default all)."
  },
  "date_columns": {
   "type": "array",
   "description": "Columns to convert to ISO 8601 (default auto)."
  },
  "phone_format": {
   "type": "string",
   "description": "digits (default) or e164."
  },
  "email_columns": {
   "type": "array",
   "description": "Email columns (default auto)."
  },
  "phone_columns": {
   "type": "array",
   "description": "Phone columns (default auto by header)."
  },
  "fuzzy_threshold": {
   "type": "number",
   "description": "Similarity 0.5-1 (default 0.92)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/csv-data-cleanup-deduplication-api-6f906a87/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from well-016-datacleanup.rainmaker-wells.workers.dev](https://www.zero.xyz/host/well-016-datacleanup.rainmaker-wells.workers.dev/llms.txt)
