JSON Formatter API Reference
Paste raw or minified JSON and format it with configurable indentation, or minify it by removing all whitespace. Validates syntax, reports parse errors with line/column, and optionally sorts keys or repairs malformed JSON.
Endpoint
/api/json-formatterFull URL: https://quickhelp.dev/api/json-formatter
Request
Content-Type: application/json. No authentication required for the anonymous free tier (30 req/min per IP).
| Field | Type | Required | Description |
|---|---|---|---|
| json | string | Yes | The JSON string to format or minify |
| mode | default | No | Output mode: pretty-print or minify |
| indent | default | No | Indentation: 2 spaces, 4 spaces, or tab |
| sort_keys | default | No | Sort object keys alphabetically |
| repair | default | No | Attempt to repair malformed JSON (trailing commas, single quotes, comments) |
Response
Returns application/json. On error, returns a JSON object with an error string field and an appropriate HTTP status code.
| Field | Type | Description |
|---|---|---|
| output | string | — |
| valid | boolean | — |
| error | optional | — |
| error_line | optional | — |
| error_column | optional | — |
Example
Pretty-print JSON
curl
curl -X POST https://quickhelp.dev/api/json-formatter \
-H 'Content-Type: application/json' \
-d '{"json":"{\"name\":\"Alice\",\"age\":30}","mode":"pretty","indent":2,"sort_keys":false,"repair":false}'Request body
{
"json": "{\"name\":\"Alice\",\"age\":30}",
"mode": "pretty",
"indent": 2,
"sort_keys": false,
"repair": false
}Response
{
"output": "{\n \"name\": \"Alice\",\n \"age\": 30\n}",
"valid": true
}Error codes
| Status | Meaning |
|---|---|
| 200 | Success — result in response body |
| 400 | Bad request — invalid input; error field describes the problem |
| 404 | Tool not found |
| 429 | Rate limit exceeded (30 req/min anonymous, 300 req/min free key) |
| 500 | Internal server error — transient; retry with exponential back-off |
OpenAPI spec
The full OpenAPI 3.1 specification for all tools is available at /openapi.json. Import it into Postman, Insomnia, or any OpenAPI-compatible client to get all endpoints with schema validation automatically.