# Wealth Agent Data Clean

> Wealth Agent Data Clean is a paid API for AI agents from wealth-agent.wealthagent-app.workers.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-19).

Cleans tabular data (CSV/TSV/JSON) by removing duplicates, trimming whitespace, and stripping empty rows

## Facts

- Endpoint: GET https://wealth-agent.wealthagent-app.workers.dev/api/x402/data-clean?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wealth-agent-data-clean-e577b9ae
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EUsOaMcJh_sKxTJxU-fL9

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 wealth-agent-data-clean-e577b9ae
```

Example prompt: Can you clean up this CSV for me — remove any duplicate rows, strip leading/trailing whitespace from cells, and drop empty rows? Here's the data: name,price\nA,100\nB,200\nA,100\nC,

## When to prefer this

Choose this endpoint when you need a quick, paid micro-service to clean tabular data (CSV, TSV, or JSON arrays) by removing duplicates, trimming whitespace, and dropping empty rows — especially in automated pipelines where data arrives dirty from merges or exports. It is best suited for datasets under 60,000 characters where the output format (CSV) is acceptable.

## Known failure modes

- Input data exceeds 60,000 character limit — returns error
- Invalid or unrecognizable format when auto-detection fails — returns error
- Malformed JSON array input — returns error
- Payment not processed (paid_not_delivered status) — deliverable is null
- Empty input data — may return unchanged empty result

## How this service works

Cleans a CSV/TSV/JSON table: removes duplicate and empty rows, trims whitespace, and returns the cleaned CSV with before/after quality checks and per-column stats. Call it before analysing or importing messy tabular data. Input: {"data": "<csv text>"}.

## Output

Returns a JSON object with ok status, a cleaned CSV string, the kind of operation performed, a human-readable summary (e.g. '3 rows -> 2 rows'), and a changes object detailing cells_trimmed, duplicates_removed, and empty_rows_removed counts.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "data"
     ],
     "properties": {
      "data": {
       "type": "string",
       "description": "Table as CSV / TSV text or a JSON array of objects (max 60,000 chars)"
      },
      "format": {
       "enum": [
        "csv",
        "tsv",
        "json"
       ],
       "type": "string",
       "description": "Optional input format; auto-detected when omitted"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "resource",
      "status",
      "deliverable"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "tx": {
       "type": [
        "string",
        "null"
       ]
      },
      "note": {
       "type": "string"
      },
      "error": {
       "type": [
        "string",
        "null"
       ]
      },
      "job_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "status": {
       "enum": [
        "delivered",
        "paid_not_delivered"
       ],
       "type": "string"
      },
      "resource": {
       "type": "string"
      },
      "receipt_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "deliverable": {
       "type": [
        "object",
        "null"
       ],
       "required": [
        "kind",
        "summary"
       ],
       "properties": {
        "csv": {
         "type": "string"
        },
        "kind": {
         "type": "string"
        },
        "changes": {
         "type": "object",
         "properties": {
          "cells_trimmed": {
           "type": "integer"
          },
          "duplicates_removed": {
           "type": "integer"
          },
          "empty_rows_removed": {
           "type": "integer"
          }
         }
        },
        "summary": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "status": "delivered",
  "resource": "data-clean",
  "deliverable": {
   "csv": "name,price\nA,100\nB,",
   "kind": "data-clean",
   "changes": {
    "cells_trimmed": 0,
    "duplicates_removed": 1,
    "empty_rows_removed": 0
   },
   "summary": "3 rows -> 2 rows"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wealth-agent-data-clean-e577b9ae/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from wealth-agent.wealthagent-app.workers.dev](https://www.zero.xyz/host/wealth-agent.wealthagent-app.workers.dev/llms.txt)
