# City Table Clean – Socrata/CKAN CSV Cleaner (x402)

> City Table Clean – Socrata/CKAN CSV Cleaner (x402) is a paid API for AI agents from priceplain.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Accepts a city government CSV file upload and returns a cleaned CSV with standardized dates, deduplicated rows, and a per-change audit log.

## Facts

- Endpoint: POST https://priceplain.onrender.com/v1/clean/upload?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/city-table-clean-socrata-ckan-csv-cleaner-x402-600d02e8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_06u4rWNO6hOzFVkwre5g-

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 city-table-clean-socrata-ckan-csv-cleaner-x402-600d02e8 -d '<json body>'
```

Example prompt: Can you clean up this city open data CSV I exported from Socrata — standardize the date formats and remove any duplicate rows — and give me a log of every change that was made?

## When to prefer this

Choose this endpoint when you have a Socrata or CKAN city government CSV that needs automated date standardization, deduplication, and a traceable per-change audit log before downstream ingestion or analysis. It is purpose-built for civic open-data formats and provides provenance via change logs, unlike generic CSV converters that only transform format without logging mutations.

## Known failure modes

- Non-CSV or unparseable file upload returns an error
- Very large files may time out on the Render free-tier host
- Malformed CSV with inconsistent column counts may produce incomplete cleaning
- Invalid dedupe parameter value may be ignored or cause a 400 error
- Payment not completed via x402 protocol results in 402 Payment Required with no data returned

## How this service works

Three x402-paid data APIs on one host. PricePlain: Posted US hospital prices (CMS price-transparency files), cleaned: Twin Cities, MN first. Cash and payer-negotiated rates per CPT/DRG code with canonical insurer names, provenance (source file URL + date) and data-quality flags. Posted prices, not quotes. TableGrab: public URL or file -> typed JSON tables / Markdown. City Table Clean: Socrata/CKAN city CSV cleaner with a per-change log.

## Output

Returns a JSON object containing: a cleaned CSV string with standardized dates and deduplicated rows, an array of per-row change objects (each noting row index, column, before/after values, and action taken), and a summary report with counts of each type of change applied and duplicates removed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "string",
   "format": "binary"
  },
  "dedupe": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "report": {
   "change_counts": {
    "date_standardized": 1
   },
   "duplicates_removed": 0
  },
  "changes": [
   {
    "row": 1,
    "after": "2026-10-01",
    "action": "date_standardized",
    "before": "2026-10-01T00:00:00.000",
    "column": "date"
   }
  ],
  "cleaned_csv": "case_number,date,ward\nJK437343,2026-10-01,28\n"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/city-table-clean-socrata-ckan-csv-cleaner-x402-600d02e8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from priceplain.onrender.com](https://www.zero.xyz/host/priceplain.onrender.com/llms.txt)
