# City Table Clean – Socrata/CKAN CSV Cleaner

> City Table Clean – Socrata/CKAN CSV Cleaner 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).

Cleans a public Socrata or CKAN city CSV by standardizing dates, deduplicating rows, and returning cleaned CSV plus a per-change audit log

## Facts

- Endpoint: POST https://priceplain.onrender.com/v1/clean?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-1c6b07a2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JrEVUilzQxDpP3NI87eJn

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-1c6b07a2 -d '<json body>'
```

Example prompt: Can you clean the Socrata CSV at https://data.cityofchicago.org/resource/ijzp-q8t2.csv — deduplicate rows, standardize any dates, and give me the cleaned CSV along with a log of every change that was made?

## When to prefer this

Use this endpoint when you specifically have a Socrata (/resource/xxxx-xxxx.csv, /d/xxxx-xxxx, rows.csv) or CKAN city open data URL and need standardized dates, deduplication, and a detailed per-change audit log — not just a raw download. Prefer this over generic CSV parsers when working with civic/government open data portals and you need provenance of every transformation made.

## Known failure modes

- Non-Socrata/CKAN URL returns an error or unsupported format response
- CSV exceeds 50,000 row limit — request must use max_rows to cap it
- URL returns a 403 or 404 if the dataset is private or has been removed
- Malformed or non-CSV content at the URL causes a parsing failure
- x402 payment not completed results in 402 Payment Required response

## 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 with: a 'cleaned_csv' string containing the deduplicated and date-standardized CSV data, a 'changes' array listing each row-level modification (row number, column, action taken, before/after values), and a 'report' summary with counts of each type of change applied and total duplicates removed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "https URL of a public CSV: Socrata (/resource/xxxx-xxxx.csv, /d/xxxx-xxxx, rows.csv) or CKAN resource/download URL"
  },
  "dedupe": {
   "type": "boolean",
   "default": true
  },
  "max_rows": {
   "type": "integer",
   "default": 50000,
   "maximum": 50000,
   "minimum": 1
  },
  "include_changes": {
   "type": "boolean",
   "default": true
  }
 }
}
```

## 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-1c6b07a2/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)
