# JSON to CSV Converter

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

Converts an array of JSON objects into a CSV string, with column union across rows or explicit column ordering, stringifying nested values into cells.

## Facts

- Endpoint: POST https://toolbelt402.tpoborne.workers.dev/json/to-csv
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-to-csv-converter-a7bb5c55
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IiUbnHGxjt07D2w8rnqLS

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-a7bb5c55 -d '<json body>'
```

Example prompt: Convert this JSON array into a CSV — use the column order: id, name, email, amount — and stringify any nested fields: [{"id":1,"name":"Alice","email":"alice@example.com","amount":99.5},{"id":2,"name":"Bob","email":"bob@example.com","amount":45.0}].

## When to prefer this

Use this endpoint when you have an in-memory JSON array of objects that needs to become a flat CSV — especially when rows may have heterogeneous keys (column union) or when you need a guaranteed column order. Prefer this over client-side transformation when working in an agent pipeline that lacks a native CSV library, or when you want nested values auto-stringified without extra logic.

## Known failure modes

- Input is not a valid JSON array — returns a 4xx error
- Input array contains non-object elements (e.g. primitives) — may produce malformed rows
- Explicit column list references columns not present in any row — those columns appear with all empty values
- Very large payloads may hit Cloudflare Worker size or timeout limits
- Malformed JSON body returns a parse error

## How this service works

Convert an array of JSON objects into CSV — column union across rows or explicit column order; nested values are JSON-stringified into cells.

## Output

A plain-text CSV string with a header row derived from either the union of all keys across input objects or an explicit column list. Each subsequent row corresponds to one JSON object; nested objects or arrays are JSON-stringified into their cell rather than expanded. Missing keys for a given row produce empty cells.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "rows": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "maxItems": 5000,
   "description": "Array of objects; column union across rows"
  },
  "options": {
   "type": "object",
   "properties": {
    "columns": {
     "type": "array",
     "items": {
      "type": "string"
     },
     "description": "Explicit column order"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-to-csv-converter-a7bb5c55/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
