API Documentation

Integrate JSON Tools into your applications with our RESTful API

Get API Key

Quick Start

Get started with the JSON Tools API in minutes

1. Get Your API Key

Sign up for a premium account and generate an API key from your dashboard.

2. Make Your First Request

curl -X POST https://bestoftool.com/api/tools/format \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": "{\"name\":\"John\"}"}'

3. Handle the Response

{
  "success": true,
  "result": "{\n  \"name\": \"John\"\n}",
  "meta": {
    "originalSize": 15,
    "formattedSize": 22,
    "processingMs": 5
  }
}

Authentication

All API requests require authentication

Include your API key in the Authorization header:

Authorization: Bearer jt_your_api_key_here

API Endpoints

Available tools and their endpoints

POST /api/tools/format

Format and prettify JSON with customizable indentation

Request Body

{
  "data": "{\"name\":\"John\",\"age\":30}",
  "indent": 2  // optional, default: 2
}

Response

{
  "success": true,
  "result": "{\n  \"name\": \"John\",\n  \"age\": 30\n}",
  "meta": {
    "originalSize": 26,
    "formattedSize": 38,
    "processingMs": 3
  }
}

Error Handling

Understanding error responses

Common Error Codes

  • 400 - Bad Request (invalid JSON or parameters)
  • 401 - Unauthorized (missing or invalid API key)
  • 403 - Forbidden (subscription required)
  • 429 - Too Many Requests (rate limit exceeded)
  • 500 - Internal Server Error

Error Response Format

{
  "error": "Error description",
  "message": "Detailed error message",
  "details": [] // Optional validation errors
}

Rate Limits

API usage limits for premium users

  • 1000 requests per hour per API key
  • 100MB maximum file size per request
  • 5 API keys maximum per account

Need higher limits? Contact us for enterprise plans.

Ready to Get Started?

Sign up for a premium account and start using the API today