# JSON to CSV Converter API

> JSON to CSV Converter converts an array of JSON objects into structured CSV text. It outputs formatted CSV content, detected column headers, and row counts, with support for custom delimiters like commas, tabs, or pipes.

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

## Overview

A JSON to CSV converter API: use it to convert JSON into CSV from any backend, script or no-code tool with a single POST request. Send an array of JSON objects and get back the CSV text, the list of columns it found, and the row and column counts. Objects do not need to share the same keys: every key that appears anywhere becomes a column, and missing values are left empty.

This is the step between an API response or database export and a spreadsheet, a finance import, or a report someone opens in Excel. You can pick a comma, semicolon or pipe delimiter to match the receiving system, and drop the header row when you are appending to an existing file. Values that contain the delimiter, quotes or line breaks are quoted so the file opens cleanly. Requests are limited to 500KB.

The Free plan and paid plans run the same JSON to CSV conversion and return the same fields.

## 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/jsontocsv" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"json":[{"name":"John Doe","age":30,"city":"New York"},{"name":"Jane Smith","age":25,"city":"Los Angeles"}],"delimiter":",","include_header":true,"flatten":true}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `json` | array | Yes | The JSON array to convert to CSV (must be array of objects) |
| `delimiter` | string | No | The delimiter to use in the CSV. default ,. One of: ,, ;, \t, &#124; |
| `include_header` | boolean | No | Whether to include column headers in the output (default: true). default true |
| `flatten` | boolean | No | Flatten nested objects into dot-path columns such as customer.address.city instead of writing them as JSON in one cell (default: false). default false |

## Response fields

- `row_count` — number · Total number of data rows in the converted CSV output
- `column_count` — number · Total number of columns extracted from JSON object keys
- `columns` — array · Array of column header names extracted from JSON data
- `csv` — string · Formatted CSV content with headers and data rows combined

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "row_count": 2,
    "column_count": 3,
    "columns": [
      "name",
      "age",
      "city"
    ],
    "csv": "name,age,city\nJohn Doe,30,New York\nJane Smith,25,Los Angeles"
  }
}
```

## Use cases

- **Data Export** — Convert API JSON responses to CSV format for importing into Excel, Google Sheets, or databases
- **Report Generation** — Transform JSON data into CSV reports for business intelligence tools and data analysis
- **Legacy System Integration** — Convert modern JSON APIs to CSV format for compatibility with legacy systems
- **Data Backup** — Export JSON datasets to CSV format for archival and backup purposes

## SDKs

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

## More

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