Detect a CSV file's delimiter, quote, header row and broken header names

$0.005 USDC per call · Developer and security · POST /api/v1/csv-dialect · Id csv-dialect

Detects the delimiter (comma, semicolon, tab, pipe), quote character, line terminator, BOM, header row offset (preamble lines above the header) and whether a header exists in CSV text, parsed per RFC 4180 so quoted delimiters and CRLF inside quoted fields are handled. Returns every candidate dialect with its score, each ragged row with its physical line, and header repairs (empty, duplicate or BOM-polluted names, with the deterministic replacement). Reports `unknown` when two dialects fit equally well or the file has a single column, instead of guessing. For agents about to parse an unfamiliar export. It does not coerce types or fix data rows; use csv-roundtrip for type and spreadsheet hazards.

What you get

Wrong-delimiter parses silently produce one wide column or shifted fields. 200 KB per $0.005 call, no guesses when ambiguous.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/csv-dialect. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/csv-dialect \
  -H 'content-type: application/json' \
  -d '{"text":"Export 2026-11-04\n\nid;name;note\n007;Ann;\"a;b\"\n008;Bob;ok\n"}'

Input

FieldTypeRequiredDescription
textstring; length 0..200000yesCSV text, up to 200000 characters. Detection samples the first 50000; structure checks cover all of it.

Example request body

{
  "text": "Export 2026-11-04\n\nid;name;note\n007;Ann;\"a;b\"\n008;Bob;ok\n"
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
dialectone ofno
candidatesarray<object>no
columnsone ofno
preambleRowsone ofno
headerRowone ofno
headerLineone ofno
hasHeaderstring; one of "yes", "no", "unknown"no
headerone ofno
raggedRowsarray<object>no
ambiguityone ofno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.

Machine-readable