Docs/Format Utils/POST /v1/csv-to-json

POST /v1/csv-to-jsonConvert CSV to JSON array

Format Utils lf-format-utils

Turns a spreadsheet-style list of rows into a set of labelled records. Accepts CSV text and converts it to a JSON array of objects. The first line is treated as the header row.

Query Parameters

ParameterTypeRequiredDescription
csvstringNoCSV text (alternative to body)

Response Schema

success (boolean): Operation success
json (array): Parsed JSON array
rows (integer): Number of rows
columns (integer): Number of columns

cURL Example

curl -X POST 'https://lf-format-utils.laminarforge.dev/v1/csv-to-json' -H 'Authorization: Bearer lf_YourApiKey' -H 'Content-Type: text/plain' -d 'name,age\nAlice,30\nBob,25'

Python Example

import requests
url = 'https://lf-format-utils.laminarforge.dev/v1/csv-to-json'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
data = 'name,age\nAlice,30\nBob,25'
response = requests.post(url, headers=headers, data=data)
print(response.json())