JSON to CSV

Turn a JSON array of objects into CSV, with the delimiter you choose.

Pay by wallet (x402) json-to-csv

Example

Example answer
{
  "csv": "age,city,name\n30,Stockholm,Alice\n25,Oslo,Bob",
  "columns": [
    "age",
    "city",
    "name"
  ],
  "row_count": 2,
  "column_count": 3
}

Inputs

FieldTypeRequiredWhat it is
dataarrayYesArray of objects to convert
delimiterstringNoColumn delimiter (default: comma)

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
csvstringAlways (present in every successful answer)
columnsarrayAlways (present in every successful answer)
row_countintegerAlways (present in every successful answer)
column_countintegerAlways (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": "json-to-csv",
    "inputs": {
      "data": [
        {
          "age": 30,
          "city": "Stockholm",
          "name": "Alice"
        },
        {
          "age": 25,
          "city": "Oslo",
          "name": "Bob"
        }
      ]
    },
    "max_price_cents": 2
  }'

Limitations

  • Nested objects can produce very wide CSV files

    Best with flat or shallow JSON arrays — deeply nested objects are flattened with dot notation which may produce wide CSVs

    What to do instead: Use flatten-json first with a controlled depth parameter to preview the flattened structure before converting