CSV → JSON
Try it interactively →POST /api/csv-to-jsonConvert CSV files to a JSON array of objects via HTTP. RFC 4180 parsing with quoted fields, embedded commas, and escapes. Header row → object keys.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| csv* | file | — | The CSV document. |
| prettyPrint | boolean | false | Indent the JSON output with two spaces. |
Response
Modes: json. Cache: yes (24h TTL).
Code samples
Built from the people example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/csv-to-json/people.csv
CSV=$(base64 -w0 < people.csv)
curl -X POST https://api.xtract.bot/api/csv-to-json \
-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": "'"$CSV"'"
}'