# JSON to CSV Converter

> JSON to CSV Converter is a paid API for AI agents from toolshed.lemon-agent.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-16).

Converts a JSON array of objects to a well-formed CSV file with dotted-key flattening and RFC 4180 quoting

## Facts

- Endpoint: POST https://toolshed.lemon-agent.dev/convert/json-csv
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-to-csv-converter-47710e12
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5FCUBsYBkNXTSAtH_ZH-7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability json-to-csv-converter-47710e12 -d '<json body>'
```

Example prompt: Convert this JSON array to a CSV file — it has nested fields like user.id and user.email that should become dotted column headers, and any record missing a key should just get an empty cell rather than shifting the row.

## When to prefer this

Choose this endpoint when you need reliable tabular export of a JSON array with heterogeneous keys — especially when records have missing or inconsistent fields, since it fills empty cells rather than shifting columns. It handles one level of nesting via dotted headers automatically. Prefer it over generic converters when RFC 4180 quoting compliance and consistent column ordering matter. Part of the toolshed.lemon-agent.dev suite, so it pairs naturally with its YAML-to-CSV and NDJSON endpoints for multi-format pipelines.

## Known failure modes

- Input is not a valid JSON array — returns an error indicating invalid JSON
- Body exceeds 256 KB limit — request rejected
- Input is a JSON object rather than an array — may fail or return unexpected output
- Deeply nested structures become unwieldy JSON blobs in cells rather than proper columns
- Very wide records with many unique keys produce extremely wide CSV headers

## How this service works

JSON to CSV. POST an array of objects; the response is a CSV file whose header row is the union of every record's keys in first-seen order, so a record missing a key gets an empty cell instead of a shifted row. One level of nesting flattens to dotted columns (user.id); deeper values and arrays are written as compact JSON in the cell. RFC 4180 quoting.

## Output

A plain-text CSV file (text/csv) with a header row built from the union of all record keys in first-seen order. One level of JSON nesting is flattened to dotted column names (e.g. user.id). Deeper nesting and arrays are serialized as compact JSON strings within their cell. Missing keys produce empty cells rather than shifted columns. All values are RFC 4180 quoted as needed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "string",
     "maxLength": 262144,
     "description": "the raw JSON file as the request body, up to 256 KB"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "const": "POST"
    },
    "bodyType": {
     "type": "string",
     "const": "text"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "format"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "text"
    },
    "format": {
     "type": "string",
     "const": "text/csv",
     "description": "the converted CSV file as the response body (text/csv)"
    },
    "example": {
     "type": "string",
     "description": "the sample request body above, converted — what a the converted CSV file as the response body (text/csv) looks like"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-to-csv-converter-47710e12/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolshed.lemon-agent.dev](https://www.zero.xyz/host/toolshed.lemon-agent.dev/llms.txt)
