TON API
Provide access to indexed TON blockchain
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Provide access to indexed TON blockchain
Endpoints 118
Accounts
- POSTgetAccounts
/v2/accounts/_bulkGet human-friendly information about several accounts without low-level details. - GETgetAccount
/v2/accounts/:account_idGet human-friendly information about an account without low-level details. - GETaccountDnsBackResolve
/v2/accounts/:account_id/dns/backresolveGet account's domains - GETgetAccountJettonsBalances
/v2/accounts/:account_id/jettonsGet all Jettons balances by owner address - GETgetAccountJettonBalance
/v2/accounts/:account_id/jettons/:jetton_idGet Jetton balance by owner address - GETgetAccountJettonsHistory
/v2/accounts/:account_id/jettons/history?limit=100Get the transfer jettons history for account - GETgetAccountJettonHistoryByID
/v2/accounts/:account_id/jettons/:jetton_id/history?limit=100Deprecated. Please use getJettonAccountHistoryByID instead - GETgetAccountNftItems
/v2/accounts/:account_id/nftsGet all NFT items by owner address - GETgetAccountEvents
/v2/accounts/:account_id/events?limit=20Get events for an account. Each event is built on top of a trace which is a series of transactions caused by one inbound message. TonAPI looks for known… - GETgetAccountEvent
/v2/accounts/:account_id/events/:event_idGet event for an account by event_id - GETgetAccountTraces
/v2/accounts/:account_id/tracesGet traces for account - GETgetAccountSubscriptions
/v2/accounts/:account_id/subscriptionsGet all subscriptions by wallet address - POSTreindexAccount
/v2/accounts/:account_id/reindexUpdate internal cache for a particular account - GETsearchAccounts
/v2/accounts/search?name=stringSearch by account domain name - GETgetAccountDnsExpiring
/v2/accounts/:account_id/dns/expiringGet expiring account .ton dns - GETgetAccountPublicKey
/v2/accounts/:account_id/publickeyGet public key by account id - GETgetAccountMultisigs
/v2/accounts/:account_id/multisigsGet account's multisigs - GETgetAccountDiff
/v2/accounts/:account_id/diff?start_date=1668436763&end_date=1668436763Get account's balance change - GETgetAccountDefiAssets
/v2/accounts/:account_id/defi/assetsReturn DeFi assets locked in custom smart contracts: currently returns TON Whales staking and EVAA lending positions. - GETgetAccountExtraCurrencyHistoryByID
/v2/accounts/:account_id/extra-currency/:id/history?limit=100Get the transfer history of extra currencies for an account. - GETgetJettonAccountHistoryByID
/v2/jettons/:jetton_id/accounts/:account_id/history?limit=100Get the transfer jetton history for account and jetton
Migration
- POSTgetMigrationWallets
/v2/migration/walletsGet migratable assets value (TON balance, jettons with prices, NFT count) for several wallets at once. - POSTprepareMigration
/v2/migration/preparePrepare ordered signable transactions that migrate every asset from from to to.
NFT
- GETgetAccountNftHistory
/v2/accounts/:account_id/nfts/history?limit=100Get the transfer nft history - GETgetNftCollections
/v2/nfts/collectionsGet NFT collections - GETgetNftCollection
/v2/nfts/collections/:account_idGet NFT collection by collection address - POSTgetNftCollectionItemsByAddresses
/v2/nfts/collections/_bulkGet NFT collection items by their addresses - GETgetItemsFromCollection
/v2/nfts/collections/:account_id/itemsGet NFT items from collection by collection address - POSTgetNftItemsByAddresses
/v2/nfts/_bulkGet NFT items by their addresses - GETgetNftItemByAddress
/v2/nfts/:account_idGet NFT item by its address - GETgetNftHistoryByID
/v2/nfts/:account_id/history?limit=100Deprecated. Please use getAccountNftHistory instead
Jettons
- GETgetJettons
/v2/jettonsGet a list of all indexed jetton masters in the blockchain. - GETgetJettonInfo
/v2/jettons/:account_idGet jetton metadata by jetton master address - POSTgetJettonInfosByAddresses
/v2/jettons/_bulkGet jetton metadata items by jetton master addresses - GETgetJettonHolders
/v2/jettons/:account_id/holdersGet jetton's holders - GETgetJettonTransferPayload
/v2/jettons/:jetton_id/transfer/:account_id/payloadGet jetton's custom payload and state init required for transfer - GETgetJettonsEvents
/v2/events/:event_id/jettonsGet only jetton transfers in the event
DNS
- GETgetDnsInfo
/v2/dns/:domain_nameGet full information about domain name - GETdnsResolve
/v2/dns/:domain_name/resolveDNS resolve for domain name - GETgetDomainBids
/v2/dns/:domain_name/bidsGet domain bids - GETgetAllAuctions
/v2/dns/auctionsGet all auctions
Wallet
- POSTtonConnectProof
/v2/wallet/auth/proofAccount verification and token issuance - GETgetAccountSeqno
/v2/wallet/:account_id/seqnoGet account seqno - GETgetWalletInfo
/v2/wallet/:account_idGet human-friendly information about a wallet without low-level details. - GETgetWalletsByPublicKey
/v2/pubkeys/:public_key/walletsGet wallets by public key - POSTgetWalletsByPublicKeyBulk
/v2/pubkeys/wallets/_bulkGet wallets by a list of public keys
Rates
- GETgetRates
/v2/rates?tokens=gram¤cies=gram,usd,rubGet the token price in the chosen currency for display only. Don’t use this for financial transactions. - GETgetChartRates
/v2/rates/chart?token=stringGet chart by token - GETgetMarketsRates
/v2/rates/marketsGet the Gram price from markets
Staking
- GETgetAccountNominatorsPools
/v2/staking/nominator/:account_id/poolsAll pools where account participates - GETgetStakingPoolInfo
/v2/staking/pool/:account_idStacking pool info - GETgetStakingPoolHistory
/v2/staking/pool/:account_id/historyPool history - GETgetStakingPools
/v2/staking/poolsAll pools available in network
Traces
- GETgetTrace
/v2/traces/:trace_idGet the trace by trace ID or hash of any transaction in trace
Events
- GETgetEvent
/v2/events/:event_idGet an event either by event ID or a hash of any transaction in a trace. An event is built on top of a trace which is a series of transactions caused by one…
Storage
- GETgetStorageProviders
/v2/storage/providersGet TON storage providers deployed to the blockchain.
Connect
- GETgetTonConnectPayload
/v2/tonconnect/payloadGet a payload for further token receipt - POSTgetAccountInfoByStateInit
/v2/tonconnect/stateinitGet account info by state init
Gasless
- GETgaslessConfig
/v2/gasless/configReturns configuration of gasless transfers - POSTgaslessEstimate
/v2/gasless/estimate/:master_idEstimates the cost of the given messages and returns a payload to sign - POSTgaslessSend
/v2/gasless/sendSubmits the signed gasless transaction message to the network
Multisig
- GETgetMultisigAccount
/v2/multisig/:account_idGet multisig account info - GETgetMultisigOrder
/v2/multisig/order/:account_idGet multisig order
Blockchain
- GETgetReducedBlockchainBlocks
/v2/blockchain/reduced/blocks?from=0&to=0Get reduced blockchain blocks data - GETgetBlockchainBlock
/v2/blockchain/blocks/:block_idGet blockchain block data - GETdownloadBlockchainBlockBoc
/v2/blockchain/blocks/:block_id/bocDownload blockchain block BOC - GETgetBlockchainMasterchainShards
/v2/blockchain/masterchain/:masterchain_seqno/shardsGet blockchain block shards - GETgetBlockchainMasterchainBlocks
/v2/blockchain/masterchain/:masterchain_seqno/blocksGet all blocks in all shards and workchains between target and previous masterchain block according to shards last blocks snapshot in masterchain. We don't… - GETgetBlockchainMasterchainTransactions
/v2/blockchain/masterchain/:masterchain_seqno/transactionsGet all transactions in all shards and workchains between target and previous masterchain block according to shards last blocks snapshot in masterchain. We… - GETgetBlockchainConfigFromBlock
/v2/blockchain/masterchain/:masterchain_seqno/configGet blockchain config from a specific block, if present. - GETgetRawBlockchainConfigFromBlock
/v2/blockchain/masterchain/:masterchain_seqno/config/rawGet raw blockchain config from a specific block, if present. - GETgetBlockchainBlockTransactions
/v2/blockchain/blocks/:block_id/transactionsGet transactions from block - GETgetBlockchainTransaction
/v2/blockchain/transactions/:transaction_idGet transaction data - GETgetBlockchainTransactionByMessageHash
/v2/blockchain/messages/:msg_id/transactionGet transaction data by message hash - GETgetBlockchainValidators
/v2/blockchain/validatorsGet blockchain validators - GETgetBlockchainMasterchainHead
/v2/blockchain/masterchain-headGet last known masterchain block - GETgetBlockchainRawAccount
/v2/blockchain/accounts/:account_idGet low-level information about an account taken directly from the blockchain. - POSTgetBlockchainRawAccounts
/v2/blockchain/accounts/_bulkGet low-level information about several accounts taken directly from the blockchain. - GETgetBlockchainAccountTransactions
/v2/blockchain/accounts/:account_id/transactionsGet account transactions - GETexecGetMethodForBlockchainAccount
/v2/blockchain/accounts/:account_id/methods/:method_nameExecute get method for account - POSTexecGetMethodWithBodyForBlockchainAccount
/v2/blockchain/accounts/:account_id/methods/:method_nameExecute get method for account - POSTsendBlockchainMessage
/v2/blockchain/messageSend message to blockchain - GETgetBlockchainConfig
/v2/blockchain/configGet blockchain config - GETgetRawBlockchainConfig
/v2/blockchain/config/rawGet raw blockchain config - GETblockchainAccountInspect
/v2/blockchain/accounts/:account_id/inspectBlockchain account inspect - GETgetLibraryByHash
/v2/blockchain/libraries/:hashGet library cell
Lite Server
- GETgetRawMasterchainInfo
/v2/liteserver/get_masterchain_infoGet raw masterchain info - GETgetRawMasterchainInfoExt
/v2/liteserver/get_masterchain_info_ext?mode=0Get raw masterchain info ext - GETgetRawTime
/v2/liteserver/get_timeGet raw time - GETgetRawBlockchainBlock
/v2/liteserver/get_block/:block_idGet raw blockchain block - GETgetRawBlockchainBlockState
/v2/liteserver/get_state/:block_idGet raw blockchain block state - GETgetRawBlockchainBlockHeader
/v2/liteserver/get_block_header/:block_id?mode=0Get raw blockchain block header - POSTsendRawMessage
/v2/liteserver/send_messageSend raw message to blockchain - GETgetRawAccountState
/v2/liteserver/get_account_state/:account_idGet raw account state - GETgetRawShardInfo
/v2/liteserver/get_shard_info/:block_id?workchain=1&shard=1&exact=falseGet raw shard info - GETgetAllRawShardsInfo
/v2/liteserver/get_all_shards_info/:block_idGet all raw shards info - GETgetRawTransactions
/v2/liteserver/get_transactions/:account_id?count=100<=23814011000000&hash=131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85Get raw transactions - GETgetRawListBlockTransactions
/v2/liteserver/list_block_transactions/:block_id?mode=0&count=100Get raw list block transactions - GETgetRawBlockProof
/v2/liteserver/get_block_proof?known_block=(-1,8000000000000000,4234234,3E575DAB1D25...90D8,47192E5C46C...BB29)&mode=0Get raw block proof - GETgetRawConfig
/v2/liteserver/get_config_all/:block_id?mode=0Get raw config - GETgetRawShardBlockProof
/v2/liteserver/get_shard_block_proof/:block_idGet raw shard block proof - GETgetOutMsgQueueSizes
/v2/liteserver/get_out_msg_queue_sizesGet out msg queue sizes
Emulation
- POSTdecodeMessage
/v2/message/decodeDecode a given message. Only external incoming messages can be decoded currently. - POSTemulateMessageToEvent
/v2/events/emulateEmulate sending message to retrieve general blockchain events - POSTemulateMessageToTrace
/v2/traces/emulateEmulate sending message to retrieve with a detailed execution trace - POSTemulateMessageToWallet
/v2/wallet/emulateEmulates a wallet message on the current blockchain state and derives its consequences for the signing wallet - POSTemulateMessageToAccountEvent
/v2/accounts/:account_id/events/emulateEmulate sending message to retrieve account-specific events
Utilities
- GETgetOpenapiJson
/v2/openapi.jsonGet the openapi.json file - GETgetOpenapiYml
/v2/openapi.ymlGet the openapi.yml file - GETstatus
/v2/statusStatus - GETaddressParse
/v2/address/:account_id/parseparse address and display in all formats
ExtraCurrency
- GETgetExtraCurrencyInfo
/v2/extra-currency/:idGet extra currency info by id
Purchases
- GETgetPurchaseHistory
/v2/purchases/:account_id/historyGet history of purchases
Rewards
- GETGet all current validators
/v2/rewards/validatorsReturns all current validators with stakes, rewards, pool addresses, and (optionally) nominator breakdowns. - GETGet validation round metadata
/v2/rewards/validation-roundsReturns past and current validation rounds with boundaries, stakes, and bonuses. Always uses the latest masterchain block. - GETGet per-validator reward distribution for a finished round
/v2/rewards/round-rewardsComputes per-validator and per-nominator reward distribution for a finished validation round using the elector's bonuses value. - GETGet historical APY and stake statistics
/v2/rewards/statsReturns time series of APY and total stake from past validation rounds. - GETGet current TON blockchain APY
/v2/rewards/apyReturns the current TON blockchain APY as a percent based on the latest completed validation round.
API details
- Base URL
https://tonapi.iohttps://testnet.tonapi.iohttp://localhost:8081- Authentication
- None declared in the description
- Operations
- 118 operations on 117 pathsGET 97POST 21
2 marked deprecated - Main resources
- Blockchain 23Accounts 22Lite Server 16NFT 8Jettons 6Wallet 6Emulation 5Rewards 5DNS 4Staking 4
- Response formats
application/jsonapplication/octet-streamapplication/yaml- Description format
- OpenAPI 3.0.0, API version
2.0.0 - Links
- OpenAPI document
How to test the TON API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the TON API collection, without the publisher's secrets.
- Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
- Send a requestPick an endpoint, for example “getAccounts” (POST /v2/accounts/_bulk), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the TON API?
Provide access to indexed TON blockchain It is listed under Finance & banking and has 118 endpoints.
Who publishes the TON API?
It is listed from TON API (Tonkeeper)'s public API description (an OpenAPI document), not published by TON API (Tonkeeper) on Swastik Codes. Anyone who controls tonapi.io can claim the profile by adding a DNS TXT record.
What is the base URL of the TON API?
Its description lists 3 base URLs: https://tonapi.io, https://testnet.tonapi.io, http://localhost:8081. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the TON API?
Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.
How many endpoints does the TON API have?
118 operations on 117 paths (97 GET, 21 POST). The largest groups are Blockchain, Accounts, Lite Server, NFT.
Is forking the TON API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.