JSON to CSV Converter
Convert a JSON array of objects or arrays into CSV with a header row and a custom delimiter, returned as JSON or as a downloadable text/csv file.
Result
Press “Run” to see the result.
Send a JSON array in json, either as a value or as a JSON string (a raw text/plain body also works). Each object becomes a row and its keys become the header; arrays of arrays are written as plain rows. Nested objects and arrays are serialized as JSON text inside the cell, and values with commas, quotes or line breaks are quoted correctly.
Columns are the union of the keys of all objects, in the order they first appear; missing values become empty cells. Use delimiter for a separator other than a comma (for example ; for European Excel) and header=false to omit the header row.
By default the response is JSON with csv and row_count; with format=csv the API answers with the raw CSV as text/csv, ready to save as a file. The request body is limited to 5 MB.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/json-to-csv" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"json":[{"name":"Alice","age":30,"tags":["admin","dev"]},{"name":"Bob","age":25,"tags":[]}]}'const res = await fetch('https://apibox.io.vn/v1/json-to-csv', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"json": [
{
"name": "Alice",
"age": 30,
"tags": [
"admin",
"dev"
]
},
{
"name": "Bob",
"age": 25,
"tags": []
}
]
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/json-to-csv",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"json": [{"name": "Alice", "age": 30, "tags": ["admin", "dev"]}, {"name": "Bob", "age": 25, "tags": []}]},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/json-to-csv');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"json":[{"name":"Alice","age":30,"tags":["admin","dev"]},{"name":"Bob","age":25,"tags":[]}]}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
How are nested objects handled?
Nested objects and arrays are written as JSON text in the cell, for example ["admin","dev"].
Can I download the CSV file directly?
Yes. Add format=csv and the response body is the CSV itself with Content-Type: text/csv.
Which columns are included?
Every key found in any object of the array, in the order it first appears. Objects that lack a key get an empty cell.