xtract.bot
POST /api/csv-validate

Validate a CSV without parsing it into JSON. Reports row count, column count, header names, and any rows whose column count differs from the header.

Walks a CSV and reports its structure without converting it to JSON. Surfaces: - Row count (excluding the header when `hasHeader=true`). - Column count (taken from the first row). - Header field names. - Any rows whose field count differs from the header. - Unterminated quoted fields (the most common malformed-CSV symptom). Useful as a CI lint step before piping CSVs into a downstream import or migration.

Inputs

NameTypeDefaultDescription
csv*stringCSV source.
delimiterstring","Field separator (single character). Use `\t` for TSV.
hasHeaderbooleantrueTreat the first row as a header (returned in `headers`).

Response

Modes: json. Cache: yes (24h TTL).

Code samples

Built from the ragged example.


curl -X POST https://api.xtract.bot/api/csv-validate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "csv": "name,count,price\napple,5,0.99\norange,7\nplum,2,3.50\n",
  "delimiter": ",",
  "hasHeader": true
}'