---
title: "Validate, pretty-print, minify or analyse a JSON document"
method: POST
path: "/json-format.php"
tags: ["data"]
---

# Validate, pretty-print, minify or analyse a JSON document

`POST /json-format.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/json-format.php`
- Auth: none declared

Parses the supplied JSON. Returns a structural analysis (node counts by type, max nesting depth, top distinct keys). `mode=pretty|minify|validate|analyze`.

## Request body

- object
  - `json` string, required
  - `mode` 'pretty' | 'minify' | 'validate' | 'analyze'
  - `indent` integer

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `413`: Request body or text exceeds 1 MB
- `422`: JSON parse error
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
