Back to Tool
{ }
JSON Formatter API
Format, validate, and minify JSON data programmatically
Endpoint
POST
/api/v1/json-formatterAuthentication
Include your API key in the request header:
X-API-Key: your_api_key_hereGet your API key from the Dashboard
Request Body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
| json | string | Yes | The JSON string to process |
| action | string | Yes | Action to perform: "format", "minify", or "validate" |
| indent | number | No | Number of spaces for indentation (default: 2, only for format action) |
Response
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the operation was successful |
| result | string | The formatted/minified JSON (for format/minify actions) |
| valid | boolean | Whether the JSON is valid (for validate action) |
| error | string | Error message if validation failed |
Code Examples
curl -X POST https://tools.shubhambadgujar.com/api/v1/json-formatter \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"json": "{\"name\":\"John\",\"age\":30}",
"action": "format",
"indent": 2
}'Rate Limits
- • 100 requests per minute
- • 10,000 requests per day
- • Max request size: 10MB
Need Help?
Contact us at support@shubhambadgujar.com