---
title: "Convert a JSON array of objects to CSV"
method: POST
path: "/json-to-csv.php"
tags: ["data"]
---

# Convert a JSON array of objects to CSV

`POST /json-to-csv.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/json-to-csv.php`
- Auth: none declared

Converts a top-level JSON array of objects to CSV. Optional explicit `columns` (subset/ordering), configurable `delimiter` and `newline`. With `flatten=true`, nested objects expand into dotted column names (`meta.city`, `meta.zip`). Max 50,000 rows per request.

## Request body

- object
  - `json` string, required
  - `delimiter` string
  - `include_headers` boolean
  - `columns` string[]
  - `flatten` boolean
  - `newline` '
' | '
' | ''

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `413`: Request body or text exceeds 1 MB
- `422`: JSON parse error or wrong shape
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
