Formats (JSON and TOON)

Two formats, same data

Media typeUse case
application/jsonDefault. Browsers, scripts, dashboards.
application/toonLLM and AI-agent clients. Tabular encoding, 30–60 % fewer tokens.

Field names, nullability, and the meta envelope are identical — only the wire encoding differs.

How to ask for TOON

In priority order:

  1. Accept: application/toon header (standard HTTP content negotiation).
  2. "format": "toon" field in the JSON request body (POST series endpoints).
  3. ?format=toon query parameter.
  4. Default: JSON.

The Content-Type header on the response reflects what was served. An Accept header that lists only types we don't serve returns 415 unsupported_media_type; an unknown format value returns 400 invalid_parameter.

Why TOON

TOON emits field names once as a header and writes value-only rows — exactly the shape of a tabular API response. Per-row overhead drops from object delimiters + field names + colons + commas to just commas.

Side-by-side

A 90-day OHLC pull for BTC-USDT on Binance, in JSON:

json
{
"meta": {
"source_type": "exchange",
"source": "binance",
"symbol": "BTC-USDT",
"metric_type": "candlestick",
"sides": ["ohlc"],
"resolution": "daily",
"start": "2024-01-01",
"end": "2024-03-30",
"count": 90
},
"data": [
{
"date": "2024-01-01",
"open": 42190.1,
"high": 42910.5,
"low": 41805.0,
"close": 42500.0,
"observation_count": 123456,
"price_sum": 1234567.89,
"price_variance": 12345.67
}
]
}

The same payload as TOON:

meta:
source_type: exchange
source: binance
symbol: BTC-USDT
metric_type: candlestick
sides[1]: ohlc
resolution: daily
start: 2024-01-01
end: 2024-03-30
count: 90
data[90]{date,open,high,low,close,observation_count,price_sum,price_variance}:
2024-01-01,42190.1,42910.5,41805.0,42500.0,123456,1234567.89,12345.67
2024-01-02,42501.0,43120.0,42310.5,42995.2,130210,1318222.11,11980.04

Side filtering pairs well with TOON

Most metrics carry both sides in one row (e.g. bid_amount and ask_amount). If your agent only needs one, ask for it explicitly:

shell
curl -s "https://zealous.markets/api/v1/market/limit-orders" \
-X POST \
-H "Authorization: Bearer $ZM_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/toon" \
-d '{"exchange":"binance","symbol":"BTC-USDT","side":"bid_amount","start":"2024-01-01"}'

Halves the columns and the bytes.

Quota impact

Metering is on the served body, so TOON also reduces your monthly byte quota spend.