YAML to JSON API - convert YAML or multi-document .yml to strict JSON
yaml_to_jsonConvert YAML text or a base64 .yaml/.yml file into validated RFC 8259 JSON or JSON Lines (.jsonl). Supports multi-document YAML (--- separated Kubernetes/Helm manifests), safe YAML loading with alias-bomb protection, ISO-8601 date serialization, non-string key coercion, pretty (2/4 spaces or tabs) or minified output, and optional key sorting. Deterministic, 0 AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/yaml-to-json.
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": {
"yaml": "service: billing-api\nrelease_date: 2026-11-26\nports:\n - 8080\n - 8443\ntls: true"
},
"name": "yaml_to_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| yaml | No | YAML text to convert (provide yaml, text, or fileContent) | |
| format | No | Pretty-printed or single-line minified JSON | pretty |
| indent | No | Indentation when format=pretty | 2 |
| fileName | No | Optional file name, e.g. deployment.yaml | |
| multiDoc | No | How to format multi-document YAML (---): JSON array or JSON Lines | array |
| sortKeys | No | Sort object keys alphabetically | |
| fileContent | No | Optional base64-encoded .yaml / .yml / .txt file (max 5 MB), used instead of yaml |