# CSV Clinic Preflight — CSV Validation & Cleanup Analyzer

> CSV Clinic Preflight — CSV Validation & Cleanup Analyzer is a paid API for AI agents from csv-clinic.bakongi.chatgpt.site, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-03).

Analyzes a raw CSV string and returns a detailed quality report: row/column counts, duplicate rows, blank rows, trimmed whitespace counts, header issues, and row width mismatches.

## Facts

- Endpoint: POST https://csv-clinic.bakongi.chatgpt.site/api/csv/preflight?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/csv-clinic-preflight-csv-validation-cleanup-analyzer-6b828afe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vCNRS8hJ3f5jnmHR4kagR

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-clinic-preflight-csv-validation-cleanup-analyzer-6b828afe -d '<json body>'
```

Example prompt: Can you run a preflight check on this CSV and tell me how many duplicate rows, blank rows, and whitespace issues it has? The data uses a comma delimiter: 'name,age\nAlice,30\nAlice,30\nBob, 25\n'

## When to prefer this

Choose this endpoint when you need a fast, stateless structural audit of a CSV before importing, transforming, or storing it — especially when you want to detect duplicates, blank rows, whitespace noise, and header anomalies in a single call without uploading the file to a third-party server. Ideal for agent-driven ETL pipelines, pre-import validation steps, or user-facing data quality checks where privacy matters and no data persistence is acceptable.

## Known failure modes

- CSV exceeds 256 KiB limit — request rejected
- Malformed JSON body or missing 'csv' field — 400 error
- Delimiter mismatch between specified and actual CSV content — may produce incorrect column counts
- Completely empty CSV string — may return zero rows/columns with valid_csv false
- Network timeout for very large files near size limit

## How this service works

Free CSV cleaner: remove exact duplicate and blank rows, trim whitespace, and download a cleanup report. Files stay in your browser; no upload or account.

## Output

Returns a JSON object with: validity flag (valid_csv), detected delimiter, total row and column counts, number of blank rows, duplicate rows, trimmed cells, list of empty header column indices, list of row width mismatch details, count of row width mismatches, and duplicate header groups. Provides a comprehensive structural audit of the CSV without modifying or storing the data.

## 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": {
     "type": "object",
     "required": [
      "csv"
     ],
     "properties": {
      "csv": {
       "type": "string",
       "description": "CSV document, up to 256 KiB."
      },
      "delimiter": {
       "enum": [
        ",",
        ";",
        "tab",
        "|"
       ],
       "type": "string"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "rows": {
       "type": "integer"
      },
      "status": {
       "type": "string"
      },
      "columns": {
       "type": "integer"
      },
      "valid_csv": {
       "type": "boolean"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "rows": 1,
  "status": "ok",
  "columns": 2,
  "service": "CSV Clinic Preflight API",
  "delimiter": "comma",
  "valid_csv": true,
  "blank_rows": 0,
  "trimmed_cells": 0,
  "duplicate_rows": 0,
  "empty_header_columns": [],
  "row_width_mismatches": [],
  "duplicate_header_groups": [],
  "row_width_mismatch_count": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/csv-clinic-preflight-csv-validation-cleanup-analyzer-6b828afe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from csv-clinic.bakongi.chatgpt.site](https://www.zero.xyz/host/csv-clinic.bakongi.chatgpt.site/llms.txt)
