# grist.tools CSV to JSON Converter

> grist.tools CSV to JSON Converter is a paid API for AI agents from grist.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Converts a CSV or TSV file (fetched from a URL) into a JSON array of objects or arrays, with configurable headers, delimiters, and row limits.

## Facts

- Endpoint: POST https://grist.tools/v1/csv-to-json?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/grist-tools-csv-to-json-converter-61e1ccaf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qsdh67Yf8Kkqr-af9zmz9

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 grist-tools-csv-to-json-converter-61e1ccaf -d '<json body>'
```

Example prompt: Fetch this CSV file at https://example.com/data.csv and convert it to JSON, treating the first row as headers and returning at most 500 rows.

## When to prefer this

Choose this endpoint when you need a simple, pay-per-call CSV/TSV-to-JSON conversion from a publicly accessible URL, without standing up your own parser or managing file uploads. It is ideal for one-off or infrequent conversions where a $0.005 per-call model is economical, and when strict UTF-8 enforcement and automatic delimiter detection are desirable. Prefer alternatives if you need to process private files requiring authentication, handle non-UTF-8 encodings, or convert very large files exceeding the row budget frequently.

## Known failure modes

- 415 Unsupported Media Type — unsupported or invalid charset declaration or NUL bytes in the file
- 422 Unprocessable Entity — malformed UTF-8 encoding in the CSV body
- 422 csv_extra_fields — a data row has more fields than the header when header=true
- Payment rejected or timed out — call is not charged if payment verification fails
- URL unreachable or returns non-200 — fetch of the remote CSV URL fails
- Empty or whitespace-only file — no rows returned

## How this service works

One endpoint does one thing, always the same way, for a fraction of a cent. Payment is verified before the handler runs and settled only after it succeeds, so a rejected or failed call is never a charged call.

## Output

A JSON object containing a 'rows' array (of objects when header=true, or arrays of strings when header=false), a 'truncated' boolean indicating whether the result was capped by max_rows, and detected or specified delimiter metadata. Each object uses trimmed header names as keys, with blank or duplicate names normalized automatically.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "description": "UTF-8 CSV/TSV URL. Missing charset means UTF-8; only utf-8 and utf8 declarations are accepted (case-insensitive, optionally quoted). Unsupported or invalid declarations and NUL bytes return 415; malformed UTF-8 returns 422. A UTF-8 BOM is accepted. Encoding is checked across the whole body."
  },
  "header": {
   "type": "boolean",
   "description": "Use the first nonempty record as object keys. Names are trimmed; blank names become column_<position>. Names are made unique left to right using the next unused _2, _3 suffix, including collisions with literal suffixed names. Special names remain data keys. Short rows pad with empty strings; extra fields return 422 csv_extra_fields. With false, preserve actual row widths as string arrays."
  },
  "max_rows": {
   "type": "integer",
   "description": "Maximum returned nonempty data rows. One additional nonempty record sets truncated; its width is budgeted but not checked against the header. A truncated success does not validate the entire CSV structure."
  },
  "delimiter": {
   "type": "string",
   "description": "A single field delimiter character such as \",\" or a tab; omitted, it is auto-detected from the first rows among comma, tab, pipe, semicolon and the ASCII record and unit separators, and a line break, quote or BOM given here falls back to a comma."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/grist-tools-csv-to-json-converter-61e1ccaf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from grist.tools](https://www.zero.xyz/host/grist.tools/llms.txt)
