Json prettify
Exactjson_prettifyDeterministic and authoritative — the canonical answer for this input.
Prettify (re-indent) a JSON document for readability. sort_keys orders object keys alphabetically for a stable, comparable rendering. Processing multiple inputs? Use `json_prettify_batch` to do up to 1000 in one call.
Parameters
valuestringrequiredThe JSON text to prettify.
indentintegeroptionalIndentation width in spaces.
sort_keysbooleanoptionalSort object keys alphabetically.
Call it
curl -X POST https://api.snipget.ai/v1/json/prettify \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"value":"{\"name\":\"Ada\",\"age\":36}","indent":2,"sort_keys":false}'The Batch tab sends up to 1000 inputs in one call via /v1/json/prettify/batch.
Example response
{
"input": "{\"name\":\"Ada\",\"age\":36}",
"is_valid": true,
"output": "{\n \"name\": \"Ada\",\n \"age\": 36\n}",
"original_size": 23,
"output_size": 32
}FAQ
What is this for?
It re-indents cramped or minified JSON into a clean, readable layout so a human can actually read it. The data is unchanged, only the spacing is added. The result is exact and deterministic.
Can I control the indentation?
Yes. Set indent to the number of spaces you want, from 0 up to 10. The default is 2.
What does sort_keys do?
Turning it on alphabetizes the object keys. That gives a stable, comparable layout, which is handy when you want to diff two documents that only differ in key order.
Does sorting or prettifying change my values?
No. Only whitespace and, if you ask, key ordering change. The actual values are untouched.
What if I pass invalid JSON?
You get confidence 0 and a reason naming the problem, not an error. It only reformats input that already parses as valid JSON.