Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

TONAPI

Public indexed API for TON from tonapi.io. Unlike raw Toncenter, it returns jetton operations, NFT history, and events in human-readable form — the go-to choice for DApp frontends and analytics.

Aliases: tonapi.io, ton api

TONAPI (tonapi.io) is a public indexed TON API: on top of raw blockchain data, it adds normalised jetton/NFT semantics, event search, and ready-made transaction grouping into “operations”.

How it differs from Toncenter

Toncenter is raw JSON-RPC over liteservers: you see cells, opcodes, low-level transaction structure. TONAPI is the index layer above: you see “Alice sent Bob 100 USDT, fee 0.02 TON”. For DApp UI and analytics, TONAPI usually saves you a lot of parsing.

Key endpoints

  • /v2/accounts/<address>/events — normalised account operations (TON-transfer, jetton-transfer, NFT-transfer, etc.).
  • /v2/jettons/<master>/holders — top jetton holders.
  • /v2/nfts/<collection>/itemsNFT collection with metadata.
  • /v2/blockchain/... — raw data, when you need it.

An API key is required (free tier with rate limit), available from the tonapi.io dashboard.

Tiers and limits

TierRPSPriceWhen
Free~1 RPS0prototypes, personal projects
Pro10-50 RPS$19-49/moproduction DApps, analytics
Enterpriseby contractfrom $500/moexchanges, custodial services

The key is passed in the header Authorization: Bearer <key>. Without a key, limits are stricter and there’s no SLA.

Subscribing to events

TONAPI exposes two real-time channels:

  • WebSocketwss://tonapi.io/v2/websocket for account-event subscriptions. Latency ~1-2 seconds from finality.
  • SSE (Server-Sent Events)https://tonapi.io/v2/sse/accounts/<addr>/transactions for one-way streams, convenient for bot notifications and backend watchers.

Example SSE subscription in Node:

import { EventSource } from 'eventsource';
const es = new EventSource(
  `https://tonapi.io/v2/sse/accounts/${addr}/transactions`,
  { headers: { Authorization: `Bearer ${KEY}` } },
);
es.onmessage = (e) => {
  const tx = JSON.parse(e.data);
  console.log('new tx', tx.hash, 'value', tx.value);
};

This pattern powers production bots like @CryptoBot and wallet notification services.

When TONAPI beats Toncenter

  • You need jetton operations in human-readable form (USDT-transfer, not raw cells).
  • Working with NFT collections — TONAPI returns metadata, owner, history in one call.
  • Operation search — e.g. “all swaps for this address over the last week”.
  • Ready-made aggregation — fiat balance, total inflows over a period.

When Toncenter is better:

  • You need raw BoC / cell to parse a custom smart contract.
  • You need runGetMethod against fresh state (TONAPI indexes with a 1-2 second lag).
  • You need to broadcast external messages (sendBoc) — TONAPI is indexing-only, not a broadcast endpoint.

Related terms