Validate and pretty-print JSON strings. Check if a JSON string is valid and format it with configurable indentation.
Pretty-print JSON. Body: {"input": "{...}", "indent": 2}
Request schema
Validate JSON. Body: {"input": "{...}"}
Request schema
Easiest way: the APIHub CLI. Credits cover x402, no wallet needed.
# install and set up once
npx @apihubio/cli register
npx @apihubio/cli topup 10
# call this service
npx @apihubio/cli call "https://proxy.apihub.io/json-formatter/json/format" \
-d '{"input":"{\"a\":1,\"b\":[2,3]}","indent":2}'Or call the proxy directly (curl / any HTTP client):
curl -X POST https://proxy.apihub.io/json-formatter/json/format \
-H "Authorization: Bearer ahk_your_key" \
-H "Content-Type: application/json" \
-d '{"input":"{\"a\":1,\"b\":[2,3]}","indent":2}'
# If credits available: charged automatically, returns 200
# Otherwise: returns 402 (pay via @x402/fetch or top up credits)Estimate your monthly cost for JSON Formatter.