Skip to content
Utilerio
All endpoints

JSON Formatter

POST/api/v1/tools/json-formatter

Pretty-print or minify JSON, with the exact position of any syntax error.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/json-formatter

Parameters

jsonstringrequired

JSON text to format.

indentstringoptional

Indentation style. Default 2.

24tab
sortKeysbooleanoptional

Sort object keys alphabetically.

Request body

{
  "json": "{\"a\":1}",
  "indent": "2"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/json-formatter \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"json":"{\"a\":1}","indent":"2"}'

Response

{ "formatted": "{\n  \"a\": 1\n}" }