TOON Converter API

AI-Friendly Tool Descriptions

← Back to Converter View API Documentation

For AI Agents: This page provides structured information about the TOON Converter API in a format optimized for AI consumption. The JSON response is available at /api/ai-tools when accessed programmatically.

Service Information

Service Name: TOON Converter API
Version: 1.0.0
Base URL: https://toonverter.com/api

A free API for converting between JSON and TOON (Token-Oriented Object Notation) formats. TOON reduces token usage by 30-60% compared to JSON for AI/LLM applications.

Available Tools

1. Convert Tool

Endpoint: POST /api/convert
Description: Convert JSON to TOON or TOON to JSON format

Parameters:

  • input_data (string, required): The JSON or TOON string to convert
  • direction (string, required): Either "json_to_toon" or "toon_to_json"

Response:

  • success (boolean): Whether the conversion was successful
  • output (string): The converted output string
  • output_format (string): Either "json" or "toon"
  • message (string): Status message

Example Request:

{
  "input_data": "{\"name\": \"Alice\", \"age\": 30}",
  "direction": "json_to_toon"
}

Example Response:

{
  "success": true,
  "output": "name: Alice\nage: 30",
  "output_format": "toon",
  "message": "Conversion successful"
}

Use Cases:

  • Convert JSON data to TOON format for AI/LLM applications
  • Convert TOON format back to JSON for standard processing
  • Reduce token usage when sending structured data to language models
  • Format conversion for data pipelines

2. Validate Tool

Endpoint: POST /api/validate
Description: Validate JSON or TOON input without performing conversion

Parameters:

  • input_data (string, required): The JSON or TOON string to validate
  • direction (string, required): Either "json_to_toon" (validates JSON) or "toon_to_json" (validates TOON)

Response:

  • valid (boolean): Whether the input is valid
  • message (string): Validation result message

Example Request:

{
  "input_data": "{\"name\": \"Alice\"}",
  "direction": "json_to_toon"
}

Example Response:

{
  "valid": true,
  "message": "Input is valid"
}

Use Cases:

  • Validate JSON syntax before processing
  • Validate TOON syntax before conversion
  • Check data format correctness
  • Debug format errors

About TOON Format

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).

Benefits:

  • 30-60% fewer tokens compared to JSON
  • Human-readable format
  • Supports tabular arrays for efficient data representation
  • Indentation-based structure similar to YAML

Example Conversion:

JSON:
{
  "users": [
    {"id": 1, "name": "Alice", "role": "admin"},
    {"id": 2, "name": "Bob", "role": "user"}
  ]
}
TOON:
users[2]{id,name,role}:
  1,Alice,admin
  2,Bob,user

JSON Response

To get the raw JSON response for programmatic use, make a GET request to /api/ai-tools with Accept: application/json header, or access it directly - it will return JSON by default for API clients.