Skip to content
POST /api/v1/json/format

JSON Formatter & Validator

Format, validate, and analyze JSON input with stats

Parameters

name in type required description
input body json required JSON Input
indent body number optional Indent Spaces range 0 to 8 default 2
sort_keys body boolean optional Sort Keys default false
minify body boolean optional Minify default false

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/format" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"name":"John","age":30,"hobbies":["reading","coding"]}}'

Response

The result sits under data in the standard envelope. See the response format guide for errors and status codes.

returns

data.formatted
The JSON pretty-printed with your indent and key order.
data.valid
False when the input isn't valid JSON.
data.minified
The same JSON with all whitespace removed.
data.stats
Counts of keys, depth, size and each value type.
data.error
Syntax error message, with error_position, only when invalid.
example response 200
{
    "status": "success",
    "http_code": 200,
    "code": "SUCCESS",
    "message": "JSON formatted successfully",
    "data": {
        "valid": true,
        "formatted": "{\n  \"name\": \"John\",\n  \"age\": 30,\n  \"hobbies\": [\n    \"reading\",\n    \"coding\"\n  ]\n}",
        "minified": "{\"name\":\"John\",\"age\":30,\"hobbies\":[\"reading\",\"coding\"]}",
        "stats": {
            "keys": 3,
            "max_depth": 2,
            "size_bytes": 55,
            "arrays": 1,
            "objects": 1,
            "strings": 3,
            "numbers": 1,
            "booleans": 0,
            "nulls": 0
        }
    }
}

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.

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.

cookies

We use analytics cookies to see how the site gets used. Nothing loads until you accept. Privacy policy