← All microservices
CSV and JSON converter
Data
Convert CSV to JSON or JSON to CSV. Handles quoted fields, line breaks inside cells, semicolon and tab files, BOMs and nested JSON.
What it does
- Converts both ways
- Detects comma, semicolon, tab and pipe files
- Handles quotes and line breaks inside cells
- Flattens nested JSON into columns
Good for
- Spreadsheet imports and exports
- Moving data between systems
- Quick data clean-ups
Turn on excel_safe when the CSV is headed for a spreadsheet: cells that start with = or + are then never run as formulas.
Example
POST https://bloodweb.net/api/v1/csv-json
curl -H "Authorization: Bearer YOUR_KEY" -F file=@orders.csv https://bloodweb.net/api/v1/csv-json
Options
| Name | Description |
|---|---|
filefile |
Optional: the CSV or JSON as a file, up to 10MB, instead of the text parameter. |
text
|
The CSV or JSON to convert. |
to
|
Output. Defaults to the opposite of what was sent. One of: json, csv |
delimiter
|
CSV delimiter. auto detects it when reading; writing defaults to comma. One of: auto, comma, semicolon, tab, pipe Default: auto |
header
|
CSV to JSON: the first row holds column names, giving an array of objects. Off gives an array of arrays. Default: true |
types
|
CSV to JSON: turn numbers, true/false and empty cells into JSON numbers, booleans and null. Off keeps every value as text. Default: false |
excel_safe
|
JSON to CSV: prefix cells starting with = + - @ with an apostrophe, so spreadsheets do not run them as formulas. Default: false |
bom
|
JSON to CSV: start with a UTF-8 byte order mark, which Excel needs to show accents correctly. Default: false |
Returns
application/json (an array) or text/csv. Nested JSON objects become dotted columns such as address.city.
Limits
10MB and 100,000 rows.