JSON → CSV
Try it interactively →POST /api/json-to-csvConvert a JSON array of objects to CSV. Header row derived from object keys (union or first-record). Quotes only fields that need quoting.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| json* | file | — | The JSON document. |
Response
Modes: text, json. Cache: yes (24h TTL).
Code samples
Built from the people example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/json-to-csv/people.json
JSON=$(base64 -w0 < people.json)
curl -X POST https://api.xtract.bot/api/json-to-csv \
-H "Content-Type: application/json" \
-H "Accept: text/plain" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"json": "'"$JSON"'"
}'