JSON to YAML Converter
Convert a JSON object to YAML format
Parameters
| name | in | type | required | description |
|---|---|---|---|---|
json |
body | json | required | JSON Content |
indent |
body | string | optional |
Number of spaces per indent level
one of
248 default 2
|
inline_level |
body | number | optional |
Depth at which to switch to inline YAML (higher = more expanded)
range 1 to 50
default 10
|
Request
Send your key in the X-API-Key header. More languages and patterns live on the
code examples page.
curl -s -X POST "https://apixies.io/api/v1/json-to-yaml" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"json":{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"web-app","labels":{"app":"web"}},"spec":{"replicas":3,"selector":{"matchLabels":{"app":"web"}}}}}'
Response
The result sits under data in the standard envelope. See the
response format guide for errors and status codes.
returns
- data.yaml
- The converted YAML.
- data.line_count
- Number of lines in the YAML.
- data.keys
- Count of keys in the input.
{
"status": "success",
"http_code": 200,
"code": "SUCCESS",
"message": "JSON converted to YAML successfully",
"data": {
"yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: web-app\n labels:\n app: web\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: web\n",
"is_valid_json": true,
"line_count": 11,
"keys": 11
}
}
Authentication and limits
This endpoint needs an API key. Use the sandbox ("try it" above) to test it without registering. See the authentication guide for details.
Standard rate limits apply to this endpoint.
related endpoints
More documentation
Get a free API key
A temporary key takes one click and no signup. Register and you get 75 requests/day. Free tier is for development & small projects.