# finmath CSV to JSON Converter

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

Converts a CSV string into a structured JSON array, with optional header row handling, as part of a deterministic finance math service.

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/csv_to_json
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-csv-to-json-converter-3daada87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FKLaA5LzFFF6N9y7dcv5C

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 finmath-csv-to-json-converter-3daada87 -d '<json body>'
```

Example prompt: Can you convert this CSV data into JSON for me? The first row contains headers: 'date,price,volume\n2024-01-01,150.25,10000\n2024-01-02,152.00,12000'

## When to prefer this

Use this endpoint when you need a lightweight, deterministic CSV-to-JSON conversion as part of a financial data pipeline on the finmath platform, especially when you need the output to feed into other finmath calculations (NPV, IRR, Black-Scholes, etc.) that expect structured JSON input. Prefer this over general-purpose parsing libraries when working within a USDC-metered agent workflow that already uses finmath services.

## Known failure modes

- Malformed CSV string causes parse error — returns error in result field
- Missing required 'csv' field returns a 400-style error
- Empty CSV string may return empty result array
- CSV with inconsistent column counts may produce ragged arrays or errors
- Very large CSV strings may hit payload limits on the Workers runtime

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns a JSON object with a 'result' field containing the parsed CSV as a JSON array (with objects keyed by header names if headers=true, or arrays of values if headers=false), plus a 'meta' object with processing metadata such as row count and column info.

## Example request

```json
{
 "csv": "date,price,volume\n2024-01-01,150.25,10000\n2024-01-02,152.00,12000\n2024-01-03,151.50,11500",
 "headers": true
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "csv"
 ],
 "properties": {
  "csv": {
   "type": "string",
   "description": "csv"
  },
  "headers": {
   "type": "boolean",
   "description": "headers"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

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