API Documentation
The TOON Converter API allows you to programmatically convert between JSON and TOON (Token-Oriented Object Notation) formats. TOON reduces token usage by 30-60% compared to JSON, making it ideal for AI/LLM applications.
Base URL: https://toonverter.com/api
Convert between JSON and TOON formats. This endpoint validates input and performs the conversion.
| Parameter | Type | Required | Description |
|---|---|---|---|
input_data |
string | Yes | The JSON or TOON string to convert |
direction |
string | Yes | Either "json_to_toon" or "toon_to_json" |
curl -X POST "https://toonverter.com/api/convert" \
-H "Content-Type: application/json" \
-d '{
"input_data": "{\"name\": \"Alice\", \"age\": 30}",
"direction": "json_to_toon"
}'
import requests
response = requests.post(
"https://toonverter.com/api/convert",
json={
"input_data": '{"name": "Alice", "age": 30}',
"direction": "json_to_toon"
}
)
print(response.json())
Validate JSON or TOON input without performing conversion. Useful for checking format correctness before processing.
| Parameter | Type | Required | Description |
|---|---|---|---|
input_data |
string | Yes | The JSON or TOON string to validate |
direction |
string | Yes | Either "json_to_toon" (validates JSON) or "toon_to_json" (validates TOON) |
curl -X POST "https://toonverter.com/api/validate" \
-H "Content-Type: application/json" \
-d '{
"input_data": "{\"name\": \"Alice\"}",
"direction": "json_to_toon"
}'
Get AI-friendly tool descriptions for AI agents. Returns structured information about available API endpoints in a format optimized for AI consumption.
Note: This endpoint returns JSON. For human-readable documentation, see this page or visit /api/ai-tools.
All endpoints return appropriate HTTP status codes:
Error responses include a detail field with a descriptive error message.
TOON (Token-Oriented Object Notation) is a compact, human-readable serialization format designed to reduce token usage when passing structured data to Large Language Models (LLMs).
{
"users": [
{"id": 1, "name": "Alice", "role": "admin"},
{"id": 2, "name": "Bob", "role": "user"}
]
}
users[2]{id,name,role}:
1,Alice,admin
2,Bob,user