Convert CSV to JSON or JSON to CSV. The output is the same text the tool page shows for the same input and options.
POST /api/v1/tools/csv-json-converter
Cost: 1 credit per successful request, taken from your account balance and shared by every token. A failed request is not charged.
The body is a JSON object. input is the CSV or JSON text, up to 1 MB. direction is auto, csv-to-json, or json-to-csv. auto uses the same detection as the tool page. Optional fields are header, shape, inferTypes, csvDelimiter, minify, jsonDelimiter, flatten, lineEnding, and quoteAll. Omitted fields use the tool page defaults. A successful response includes output (a string), direction, and notices. Invalid input returns 400 with the converter message. Input over 1 MB returns 413.
Example
curl https://wapgee.com/api/v1/tools/csv-json-converter \
-H "Authorization: Bearer wpg_your_token" \
-H "Content-Type: application/json" \
-d '{"input":"name,age\nAda,36","direction":"auto"}'A successful call returns:
{
"success": true,
"output": "[\n {\n \"name\": \"Ada\",\n \"age\": \"36\"\n }\n]\n",
"direction": "csv-to-json",
"notices": []
}