tonlib
to query data from liteservers and exposes it
through a standard REST interface. API v3 extends this model by reading raw data from a node’s
RocksDB storage, parsing and decoding that data, and storing it in PostgreSQL.
Base URLs
| API | Mainnet | Testnet |
|---|---|---|
| API v2 | https://toncenter.com/api/v2 | https://testnet.toncenter.com/api/v2 |
| API v3 | https://toncenter.com/api/v3 | https://testnet.toncenter.com/api/v3 |
Typical use cases
API v2
- Query account balances and state
- Run get-methods on smart contracts
- Send or broadcast messages
- Retrieve latest transactions and block information
API v3
- Query historical transactions and traces
- Retrieve decoded Jetton and NFT data
- Run analytical or filtered searches across multiple accounts
- Power explorers or reporting tools
Endpoints API v2
| Category | Method | Description |
|---|---|---|
| Accounts | GET /detectAddress | Detect all address formats and return normalized versions |
| Accounts | GET /getAddressBalance | Get balance for an address |
| Accounts | GET /getAddressInformation | Get account info including balance and state |
| Accounts | GET /getExtendedAddressInformation | Extended account info (wallet type, seqno, etc) |
| Accounts | GET /getJettonBalances | Get Jetton balances for a wallet |
| Accounts | GET /getMasterchainInfoExt | Get extended masterchain info |
| Accounts | GET /getNftItemsByCollectionAddress | Get NFT items by collection |
| Accounts | GET /getTokenData | Get Jetton metadata by master address |
| Accounts | GET /packAddress | Convert raw address to user-friendly format |
| Accounts | GET /unpackAddress | Convert user-friendly address to raw format |
| Blocks | GET /getBlockHeader | Get block header metadata |
| Blocks | GET /getBlockTransactions | Get transactions in a block |
| Blocks | GET /getConfigParam | Get specific config parameter |
| Blocks | GET /getConfigAll | Get all config parameters |
| Blocks | GET /getMasterchainBlockSignatures | Get masterchain block signatures |
| Blocks | GET /getMasterchainInfo | Get last masterchain block info |
| Blocks | GET /getRawBlockHeader | Get raw block header |
| Blocks | GET /getRawMasterchainInfo | Get raw masterchain info |
| Blocks | GET /getRawShardBlockHeader | Get raw shard block header |
| Blocks | GET /getTime | Get server time |
| Blocks | GET /lookupBlock | Lookup block by seqno/lt/root hash |
| Config | GET /getConfigParam | Get specific config parameter |
| Config | GET /getConfigAll | Get all config parameters |
| Transactions | GET /getTransactions | Get account transactions |
| Transactions | GET /tryLocateSourceTx | Try to find source transaction by message hash |
| Transactions | GET /tryLocateResultTx | Try to find result transaction by message hash |
| Messages and transactions | POST /sendBoc | Send BOC to the network |
| Messages and transactions | POST /sendBocReturnHash | Send BOC and return its hash |
| Messages and transactions | POST /sendQuery | Send external query to liteserver |
| Messages and transactions | GET /tryLocateTx | Try to find transaction by message hash |
| Smart contracts | POST /runGetMethod | Run a get-method on a smart contract |
| JSON-RPC | POST /jsonRPC | Proxy JSON-RPC requests to liteservers |
Endpoints API v3
| Category | Method | Description |
|---|---|---|
| Accounts | GET /accounts | List or search accounts with filters |
| Accounts | GET /accounts/{account_id} | Get account details by ID |
| Accounts | GET /accounts/{account_id}/transactions | List transactions for an account |
| Accounts | GET /accounts/{account_id}/actions | List high-level actions for an account (DEX, Jettons, NFTs, etc) |
| Actions and traces | GET /actions | List decoded high-level actions like swaps, transfers, or stake operations |
| Actions and traces | GET /traces | List full transaction traces with filters and pagination |
| Actions and traces | GET /emulateTrace | Emulate a transaction trace for a given external message or BOC |
| Actions and traces | GET /emulateActions | Classify emulated traces into actions |
| Blockchain data | GET /transactions/{hash} | Get transaction by hash |
| Blockchain data | GET /transactionsByMessage | Find transactions by message hash |
| Blockchain data | GET /blocks/{workchain}/{shard}/{seqno} | Get a specific block by coordinates |
| Blockchain data | GET /blocks | Search or filter blocks with pagination |
| Blockchain data | GET /messages/{hash} | Get message by hash |
| Blockchain data | GET /messages | Search messages with filters |
| Blockchain data | GET /validators | Get current validators and info |
| Blockchain data | GET /masterchain | Get masterchain status |
| Blockchain data | GET /shards | List active shards and their info |
| Blockchain data | GET /workchains | List all configured workchains |
| Jettons | GET /jettons | List all Jetton contracts |
| Jettons | GET /jettons/{master} | Get Jetton master contract info |
| Jettons | GET /jettons/{master}/holders | List holders of a Jetton |
| Jettons | GET /jettons/{master}/transactions | Get Jetton transactions |
| NFTs | GET /nfts | List NFTs (items or collections) |
| NFTs | GET /nfts/{collection} | Get NFT collection details |
| NFTs | GET /nfts/{collection}/{item} | Get specific NFT item details |
| DNS | GET /dns/{domain} | Resolve TON DNS records |
| Utils | GET /estimateFee | Estimate fees for an external message |
| Utils | GET /detectAddress | Normalize and inspect address formats |
| Stats and analytics | GET /stats | Retrieve aggregated network and protocol statistics |
| Legacy (v2-compatible) | POST /runGetMethod | Run get-method |
| Legacy (v2-compatible) | POST /sendBoc | Send BOC |
| Legacy (v2-compatible) | POST /sendBocReturnHash | Send BOC and return hash |
| Legacy (v2-compatible) | GET /getAddressInformation | Get address info |
| Legacy (v2-compatible) | GET /getTransactions | Get transactions |