CSV preflight API: validate a CSV before ingest
Check CSV text before importing: returns a verdict (ok), problems with line numbers (empty or missing header, no data rows, ragged rows with field counts, duplicate headers, mixed column types, unterminated quotes, mojibake), the detected delimiter and a per-column type report. Use before ingesting a CSV export.
When to use it
- Check a CSV export for problems before importing it
- Catch ragged rows, missing or duplicate headers and mixed column types
- Get the detected delimiter and per-column types (integer/number/boolean/string/mixed/empty) with line numbers
$0.001 per call with prepaid credits: $1 by card pays for 1,000 calls, with no account and no subscription.
Inputs
| Name | Type | Description |
|---|---|---|
text (required) | string | The CSV text to validate (first row is the header) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://glyphcall.com/csv/preflight?text=name%2Cage%0AAda%2C36%0ABob%2C41"
Or one of your 3 free calls, no key:
curl "https://glyphcall.com/csv/preflight?text=name%2Cage%0AAda%2C36%0ABob%2C41&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"ok": true,
"delimiter": ",",
"rowCount": 2,
"raggedRowCount": 0,
"blankLines": 0,
"header": [
"name",
"age"
],
"columnTypes": {
"name": "string",
"age": "integer"
},
"problems": []
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is csv_preflight, and the first 25 successful calls are free:
https://glyphcall.com/mcp
Questions
Is a blank line a problem?
It is reported but ignored by parsers; a truly broken CSV gives ok=false.
Do quotes inside fields need escaping?
Yes, as double quotes; the preflight catches unterminated quotes.
How do I pay?
Each successful call costs $0.01; failed calls are not charged. The first 3 calls are free (25 through an MCP client). Then pay with card credits (from $1; the key goes in an Authorization header or, for clients that can only fetch a URL, as api_key= in the URL) or per call in USDC over x402 or MPP. No account is needed.