Convert your data without writing a parser
A CSV export to turn into JSON, an XML feed to read, a YAML file to check: send the document, get the format you want.
- Make, Zapier, n8n integrations
- Catalogue imports
- Migrations
- Reporting scripts
POST
/v1/convert
1 credit(s) per callConverts a document between JSON, CSV, XML and YAML. Variant: send the raw document with ?from=csv&to=json as URL parameters; the response is then the converted document.
Try it online
Result
—
Example request
curl -X POST https://supercalcula.ch/api/v1/convert \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"from":"csv","to":"json","data":"name,city\nAlexandre,Genève"}'
const res = await fetch("https://supercalcula.ch/api/v1/convert", {
method: "POST",
headers: { Authorization: "Bearer sk_live_…", "Content-Type": "application/json" },
body: JSON.stringify({
"from": "csv",
"to": "json",
"data": "name,city\nAlexandre,Genève"
}),
});
const data = await res.json();
import requests
r = requests.post("https://supercalcula.ch/api/v1/convert",
headers={"Authorization": "Bearer sk_live_…"},
json={"from":"csv","to":"json","data":"name,city\nAlexandre,Genève"})
print(r.json())
$ch = curl_init("https://supercalcula.ch/api/v1/convert");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_…", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["from" => "csv", "to" => "json", "data" => "name,city\nAlexandre,Genève"]),
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
Response
{
"ok": true,
"data": {
"to": "json",
"result": "[\n {\n \"name\": \"Alexandre\",\n \"city\": \"Genève\"\n }\n]",
"rows": 1
}
}Limits and cost
- Cost : 1 credit(s) per call
- Document: 1 MB (Free plan), 10 MB (Starter and Pro)
- Syntax errors with the line number
- XML without DTD or external entities