infile
Local File
or URL
Or Data
string
This is the input file: raw data, or URL. Choose one of the options of "Local File", "URL", or "Data"
curl -X POST "https://www.convertcsv.io/api/v1/csv2json/" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
array
boolean
Output JSON as an array
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?array=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
autonum
string
Fields to display as numeric if numeric string
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?autonum=3,4" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
camel
boolean
Use camelCase keys based on column headers. Note that you can use option headover to override existing headers or supply if file has no header row. Example: A column header of Full Name will become fullName as in {"fullName": "Bob Bailey"}
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?camel=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
delimiter
string
Input file delimiter, default is automatic detection. You usually will not need to use this.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?delimiter=%5E" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
encoding
string
File encoding - if not passed, the converter will attempt to determine the encoding by looking at the first few thousand bytes of the file. Typical values are: utf-8, utf-16.
You can see a list of all supported types here: https://docs.python.org/3/library/codecs.html
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?encoding=ascii" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
exclude
string
Exclude these fields in conversion. Use this if you want to convert all fields except these.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?exclude=5" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
exnulls
string
Do not output NULL for NULL in these fields. Many CSV files have NULL for NULL fields in a database table. The default is to convert those to NULL in SQL for instance, or null in JSON, however, NULL can be a legitimate value. Use this option to exclude fields from the default conversion.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?exnulls=5" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
fields
string
Include these fields in conversion. You specify fields by their position, starting at 1. If you wanted the first 5 fields, you can type 1,2,3,4,5 or 1-5. The default is to include all fields.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?fields=1,2,3" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
force
string
Fields to force as strings. When outputting JSON, use this to output a string value instead of a numeric or boolean.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?force=5" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
force_json
string
Fields to force as JSON when converting CSV to JSON- i.e. 4,5. Normally, a JSON string in a CSV column would convert as a JSON string, but this option will use it as is - JSON.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?force_json=4,5" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
headover
string
List of header columns - Use this to override the headers on the CSV file. If the input has no headers (as specified by parameter noheader), then this parameter is a way to specify the headers.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?headover=pk,fullname,amount,comment" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
key
string
Generate Keyed JSON and pass the column position of the key(starting with 1), or the column name
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?key=id" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
limit
integer
Limit number of output records to N, i.e. 100. If you have a large output file, use this option to limit your output.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?limit=10" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
lines
boolean
Input file is JSON Lines (JSON ND). This is auto-detected so setting this option allows auto-detection to be skipped. If converting to JSON - then use this to output JSON Lines.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?lines=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
lower
string
Output lower case for these fields
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?lower=6" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
noheader
boolean
Input CSV file has no column headings
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?noheader=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
nulls
string
Convert 'NULL' to a NULL SQL value or null JSON value. Many popular tools export the string NULL in place of NULL values in tables. By default, the converter will convert ALL NULL values to a NULL SQL value or null JSON value. If you use this option, only the fields specified will be converted. See also exnulls.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?nulls=1,5,6" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
password
string
Password for URL data source
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?password=bob&username=bee" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
pretty
boolean
Generate pretty output
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?pretty=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
sample
integer
Sample N record from input file. Default is the whole file. The purpose of sample is to determine the structure and data types of the input file.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?sample=100" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
skipempty
boolean
Do not output empty values
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?skipempty=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
skiplines
integer
Skip/Ignore N record at top of input file. You may have a CSV file with empty lines or extra verbiage at the top. Use this option to skip those lines.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?skiplines=2" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
skipnull
boolean
When converting to JSON, this option will prevent null array entries and null key values from outputting.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?skipnull=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
suppress
boolean
Supress line break in data
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?suppress=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
top
string
Top level key name
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?top=master" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
trim
string
Trim leading and trailing spaces for these fields. Use column positions to identify the fields. For instance if you always want fields 4 and 5 without leading and trailing spaces, then use this option.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?trim=4,5" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"
upper
string
Output upper case for these fields
curl -X POST "https://www.convertcsv.io/api/v1/csv2json=4,5" -F "infile=@[YOUR FILE]" -F "upper=1-4" -H "Authorization: Token [YOUR TOKEN]"
username
string
Username for URL data source. This is only used when URLs are the data source. See password also.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?username=johnny&password=xyz" -F "infile=https://www.xyz.com/myinputfile.csv" -H "Authorization: Token [YOUR TOKEN]"
xin
boolean
Input file is an Excel file with either .xlsx or .xls extension. If your column headers do not start on line 1, then use the "skiplines" option to skip to the header or data.
curl -X POST "https://www.convertcsv.io/api/v1/csv2json?xin=1" -F "infile=@[YOUR FILE]" -H "Authorization: Token [YOUR TOKEN]"