# JSON ↔ YAML Bidirectional Converter

> JSON ↔ YAML Bidirectional Converter is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-14).

Converts between JSON and YAML formats bidirectionally with pretty-printing

## Facts

- Endpoint: GET https://api.x402node.dev/convert/json-yaml
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-fe5a2b12
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V-ue51Y5eQYCAOuOqDF-m

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-x402node-dev-fe5a2b12
```

Example prompt: Convert this JSON object to YAML for me: {"name": "my-service", "port": 8080, "debug": true, "tags": ["web", "api"]}

## When to prefer this

Use this endpoint when you need a quick, stateless bidirectional conversion between JSON and YAML without spinning up a local parser — ideal for config file transformations, CI/CD pipelines, or when an AI agent needs to reformat structured data on the fly. Prefer this over a CSV or XML converter when the data is specifically JSON/YAML.

## Known failure modes

- Invalid JSON input returns an error (malformed JSON, trailing commas, unquoted keys)
- Invalid YAML input returns a parse error (bad indentation, illegal characters)
- Empty or null body may return a 400-level error
- Ambiguous input format may cause incorrect format detection

## How this service works

JSON to YAML, YAML to JSON, yaml parser, json to yaml converter, config file converter, yaml config, json string to yaml, convert yaml to json, yml json. Bidirectional convert between JSON and YAML with pretty-print. Accepts payment on Base or Solana — either network works.

## Output

Returns an object with a 'result' field containing the converted string (YAML or JSON), plus 'from' and 'to' fields indicating the source and target format. The output is pretty-printed for readability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "content"
     ],
     "properties": {
      "from": {
       "type": "string",
       "description": "Source format (optional)"
      },
      "content": {
       "type": "string",
       "description": "Content body (required)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-fe5a2b12/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
