API Overview
Integrate TOON conversion into your applications with our simple REST API. Convert JSON objects to TOON format with built-in rate limiting and error handling.
Fast Conversion
Lightning-fast JSON to TOON conversion with minimal latency.
Rate Limited
100 requests per hour per IP address to ensure fair usage.
Always Available
99.9% uptime with global CDN distribution via Vercel.
Convert Endpoint
Convert JSON objects to TOON format
POST
https://toontools.site/api/convertHeaders
Content-Type: application/json
Request Body
JSON object to convert
{
"users": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
{
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com"
}
],
"total": 2
}Response
TOON formatted output
users:
[2]{id,name,email}:
1,John Doe,john@example.com
2,Jane Smith,jane@example.com
total: 2Rate Limiting
API requests are limited to prevent abuse
Limits
- • 100 requests per hour per IP
- • Automatic reset every hour
- • Based on client IP address
Response Headers
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 2024-01-01T12:00:00.000Z X-RateLimit-Used: 5
Error Handling
API error responses and status codes
200 OK
Successful conversion
400 Bad Request
Invalid JSON or validation error
429 Too Many Requests
Rate limit exceeded
500 Internal Error
Server error
Error Response Format
{
"error": "Rate limit exceeded",
"message": "Too many requests. Try again in 60 minutes.",
"retryAfter": 3600
}Code Examples
Integrate the API in your applications
JavaScript
const response = await fetch('https://toontools.site/api/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
users: [{ id: 1, name: 'John' }]
})
});
const toonData = await response.text();
console.log(toonData);Python
import requests
response = requests.post(
'https://toontools.site/api/convert',
json={"users": [{"id": 1, "name": "John"}]}
)
toon_data = response.text
print(toon_data)cURL
curl -X POST https://toontools.site/api/convert \
-H "Content-Type: application/json" \
-d '{"users": [{"id": 1, "name": "John"}]}'