API CatalogJSON Formatter

JSON Formatter API

Validate, format, minify, and optionally sort JSON. Use it in developer tools, admin panels, data cleaning workflows, and automation pipelines.

Endpoint

POST /v1/dev/data/json/format

Request body

FieldTypeRequiredDescription
textstringYesJSON string to validate or format.
indentnumberNoIndent size from 0 to 8. Defaults to 2.
sort_keysbooleanNoSort object keys. Defaults to false.

Example request

curl --request POST \
  --url https://apimask-developer-utilities-api.p.rapidapi.com/v1/dev/data/json/format \
  --header "Content-Type: application/json" \
  --header "X-RapidAPI-Key: $RAPIDAPI_KEY" \
  --header "X-RapidAPI-Host: apimask-developer-utilities-api.p.rapidapi.com" \
  --data '{"text":"{\"name\":\"ApiMask\",\"ok\":true}","indent":2,"sort_keys":false}'

Example response

{
  "success": true,
  "data": {
    "is_valid": true,
    "formatted": "{\n  \"name\": \"ApiMask\",\n  \"ok\": true\n}",
    "minified": "{\"name\":\"ApiMask\",\"ok\":true}",
    "error": null,
    "type": "object"
  },
  "error": null,
  "meta": {}
}