# CSV to JSON (`convert.csv_to_json`)

Parse CSV (RFC 4180 quoting, auto-detected delimiter) into JSON rows keyed by the header, with optional number and boolean typing.

- **Route:** `POST /v1/run/convert.csv_to_json`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 1 ms · p95 1 ms · p99 1 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `csv` | string | yes |  | CSV text |
| `delimiter` | string | no | "auto" | Field delimiter; auto picks from , ; tab | |
| `header` | boolean | no | true | First row holds the column names |
| `typed` | boolean | no | true | Turn numbers, true/false and empty cells into JSON types |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `columns` | Column names. |
| `rows` | Rows as objects (or arrays when header=false). |
| `row_count` | Number of data rows. |
| `delimiter` | Delimiter used. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/convert.csv_to_json \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv":"name,price,in_stock\n\"Widget, large\",9.5,true\nGadget,12,false"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('convert.csv_to_json', {'csv': 'name,price,in_stock\n"Widget, large",9.5,true\nGadget,12,false'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run convert.csv_to_json '{"csv":"name,price,in_stock\n\"Widget, large\",9.5,true\nGadget,12,false"}'
```

Quote first (free, validates input): `POST /v1/quote/convert.csv_to_json` with the same body.
