# CSV to JSON Converter API

> CSV to JSON Converter parses raw CSV text into an array of JSON objects with column names and row counts. It handles comma, semicolon, tab, or pipe delimiters, with optional header row detection.

**Endpoint:** `POST https://api.apiverve.com/v1/csvtojson`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/csvtojson

## Overview

CSV to JSON Converter works by parsing CSV data and converting it into JSON objects. It automatically detects columns, handles quoted values, and supports custom delimiters. Maximum file size is 500KB.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/csvtojson" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv":"name,age,city\nJohn Doe,30,New York\nJane Smith,25,Los Angeles","delimiter":",","has_header":true}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `csv` | string | Yes | The CSV data to convert to JSON |
| `delimiter` | string | No | The delimiter used in the CSV. When omitted, it is detected from the header line (comma, semicolon, tab or pipe), so European Excel exports with ; work as-is. default ,. One of: ,, ;, \t, &#124; |
| `has_header` | boolean | No | Whether the first row contains column headers (default: true). default true |

## Response fields

- `row_count` — number · Number of data rows in the converted JSON
- `column_count` — number · Number of columns detected in the CSV
- `columns` — array · Array of column names from header or auto-generated; repeated headers are renamed name_2, name_3 so each matches a key in json
- `inferredTypes` — object · Detected data type for each column (integer, float, boolean, date, email, string) · (premium)
  - `inferredTypes.name` — string · (premium)
  - `inferredTypes.age` — string · (premium)
  - `inferredTypes.city` — string · (premium)
  - `json.0.name` — string
  - `json.0.age` — string
  - `json.0.city` — string

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "row_count": 2,
    "column_count": 3,
    "columns": [
      "name",
      "age",
      "city"
    ],
    "inferredTypes": {
      "name": "string",
      "age": "integer",
      "city": "string"
    },
    "json": [
      {
        "name": "John Doe",
        "age": "30",
        "city": "New York"
      },
      {
        "name": "Jane Smith",
        "age": "25",
        "city": "Los Angeles"
      }
    ]
  }
}
```

## Use cases

- **Data Migration** — Convert CSV exports from legacy systems to JSON format for modern API integration and database imports
- **API Integration** — Transform CSV data into JSON format for RESTful API consumption and web application processing
- **Data Analysis** — Convert CSV datasets to JSON for easier manipulation in JavaScript, Python, or data analysis tools
- **File Processing** — Automate batch conversion of CSV files to JSON for data pipelines and ETL workflows

## SDKs

- **npm** — `npm install @apiverve/csvtojson` (https://www.npmjs.com/package/@apiverve/csvtojson)
- **NuGet** — `dotnet add package APIVerve.API.CSVtoJSONConverter` (https://www.nuget.org/packages/APIVerve.API.CSVtoJSONConverter)
- **Source** — https://github.com/apiverve/csvtojson-api

## More

- Full reference: https://docs.apiverve.com/ref/csvtojson
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
