CSV to JSON
Turn CSV text into a JSON array, detecting the delimiter and value types.
Pay by wallet (x402)
csv-to-json Example
Input
{
"csv_string": "test_value"
} Answer
{
"data": [],
"columns": [
"test_value"
],
"row_count": 0,
"detected_delimiter": ","
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
delimiter | string | No | — |
csv_string | string | Yes | — |
has_header | boolean | No | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
data | array | Always (present in every successful answer) |
columns | array | Always (present in every successful answer) |
row_count | integer | Always (present in every successful answer) |
detected_delimiter | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "csv-to-json",
"inputs": {
"csv_string": "test_value"
},
"max_price_cents": 2
}' {
"tool": "strale_execute",
"arguments": {
"slug": "csv-to-json",
"inputs": {
"csv_string": "test_value"
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "csv-to-json",
inputs: {
"csv_string": "test_value"
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="csv-to-json",
inputs={
"csv_string": "test_value",
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/csv-to-json?csv_string=test_value' Limitations
Mixed delimiters or multiline cells can cause errors
Expects well-formed CSV with consistent column counts — multi-line cell values or mixed delimiters may cause parse errors
What to do instead: Pre-clean the CSV with csv-clean before converting, or specify the delimiter explicitly
Related tools
- Address Parser €0.05
- Company Industry Classification €0.05
- Company Name Match €0.02
- Credit Score Band €0.02
- CSV Cleaner €0.02
- Data Quality Check €0.02