YAML to JSON Converter
Convert YAML content to JSON format
Parameters
| name | in | type | required | description |
|---|---|---|---|---|
yaml |
body | string | required | YAML Content |
pretty |
body | boolean | optional | Pretty Print |
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/yaml-to-json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"yaml":"apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\n labels:\n app: web\nspec:\n selector:\n app: web\n ports:\n - port: 80\n targetPort: 8080"}'
Response
The result sits under data in the standard envelope. See the
response format guide for errors and status codes.
returns
- data.json
- The converted JSON, as a string.
- data.document_count
- Number of YAML documents in the input.
- data.keys
- Count of keys across the parsed data.
{
"status": "success",
"http_code": 200,
"code": "SUCCESS",
"message": "YAML converted to JSON successfully",
"data": {
"json": "{\n \"apiVersion\": \"v1\",\n \"kind\": \"Service\",\n \"metadata\": {\n \"name\": \"my-service\",\n \"labels\": {\n \"app\": \"web\"\n }\n },\n \"spec\": {\n \"selector\": {\n \"app\": \"web\"\n },\n \"ports\": [\n {\n \"port\": 80,\n \"targetPort\": 8080\n }\n ]\n }\n}",
"is_valid_yaml": true,
"document_count": 1,
"keys": 12
}
}
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.