JSON to YAML API - convert JSON to YAML and YAML to JSON
json_to_yamlConvert JSON to YAML or YAML to JSON (auto-detected or forced), 2 or 4 space indent, optional keys A to Z. Safe YAML loader (nothing executes); a syntax mistake returns 400 with the line. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/json-to-yaml.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "{\"name\": \"Anna\", \"tags\": [\"a\", \"b\"], \"active\": true}",
"direction": "j2y"
},
"name": "json_to_yaml"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Your JSON or YAML text | |
| indent | No | 2 or 4 spaces | 2 |
| sortKeys | No | Sort keys A to Z | |
| direction | No | auto, j2y (JSON to YAML) or y2j (YAML to JSON) | auto |