Back to Tool
{ }

JSON Formatter API

Format, validate, and minify JSON data programmatically

Endpoint

POST/api/v1/json-formatter

Authentication

Include your API key in the request header:

X-API-Key: your_api_key_here

Get your API key from the Dashboard

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
jsonstringYesThe JSON string to process
actionstringYesAction to perform: "format", "minify", or "validate"
indentnumberNoNumber of spaces for indentation (default: 2, only for format action)

Response

FieldTypeDescription
successbooleanWhether the operation was successful
resultstringThe formatted/minified JSON (for format/minify actions)
validbooleanWhether the JSON is valid (for validate action)
errorstringError 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
  }'

Pricing

$0.0010 per call

Get API Key

Rate Limits

  • • 100 requests per minute
  • • 10,000 requests per day
  • • Max request size: 10MB

Need Help?

Contact us at support@shubhambadgujar.com