I-Best Free CSV kuya ku-JSON Converter
Guqula ama-CSV imidwebo ibe yi-JSON ehlanzekile yezinto - ikhululekile, ifakwe noma ilayishwe phezulu, akukho okugcinwayo.
Indlela esebenza ngayo
- Sinikeza i-CSV. Ncamashi umbhalo wakho we-CSV noma ulayishe ihele le-.csv.
- Misela izinketho. Usho ukuthi ngabe umugqa wokuqala yisihloko bese ukhetha isihlukanisi (i-comma, i-tab, …).
- Thola i-JSON. Kopela i-JSON efomethwe ngokugcwele, noma uyilayishe njengehele le-.json.
Ngolu thuluzi
CSV kuya ku-JSON iguqula idatha ye-CSV ye-tab CSV ibe yi-JSON array ongayisebenzisa kukhodi noma ku-API. Ncamashi i-CSV noma ulayishe ifayela le-.csv, tshela ukuthi i-row yokuqala iyisihloko, futhi ukhethe umgcini uma ayi-comma. Nge-row yesihloko, yonke imigqa izoba yi-JSON object ehlobene ngegama lekholam; ngaphandle, yonke imigqa izoba yi-array. I-output iphrintiwe kahle futhi ilungele ukukopisha noma ukufaka. Ihlela konke ku-request futhi igcina lutho.
Ubani osebenzisa lokhu
- I-data yespreadsheet ifakwa ku-API noma ku-app
- Guqula i-CSV ekhishwayo ibe yi-JSON yekhodi
- Guqula oxhumana naye noma uhlu lwemikhiqizo ube yi-JSON ehlakaniphile
- I-prototype nedatha esemthethweni ngaphandle kokubhala isibalo
Umthuthukisi we-API
Yenza lokhu kusetshenziswa kube lula kusuka kukhodi yakho. Thumela isicelo se-POST esifike esiphethweni esingezansi bese uthola imiphumela efanayo kusetshenziswa kwewebhu. Kukhawulelwe nge-rate nge-IP futhi akufanele ungene - amathuluzi we-API afinyelela ezingeni eliphakeme.
https://best.free/api/tools/csv-to-json/
| Amapharamitha | Isibonelo | Kudingeka | Amabhukwana |
|---|---|---|---|
text |
name,age\nAda,36 |
Yebo | CSV text (or upload a file on the web form). |
delimiter |
, |
Akukho | Field delimiter (use "tab" for TSV). |
header |
True |
Akukho | First row is a header. |
curl -X POST https://best.free/api/tools/csv-to-json/ \
-H 'Content-Type: application/json' \
-d '{"text": "name,age\\nAda,36", "delimiter": ",", "header": true}'
import requests
r = requests.post(
"https://best.free/api/tools/csv-to-json/",
json={"text": "name,age\nAda,36", "delimiter": ",", "header": True},
)
print(r.json())
const r = await fetch("https://best.free/api/tools/csv-to-json/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "name,age\nAda,36", delimiter: ",", header: true }),
});
const data = await r.json();
console.log(data);
Uphendulelo: JSON with the converted array in "json".
{"ok": true, "json": "[\n {\"name\": \"Ada\", \"age\": \"36\"}\n]"}