
Ton Http
- 4 installs
- 4 repo stars
- Updated February 25, 2026
- hairyf/blockchain-skills
Query TON via the TON Center HTTP API (ton-http-api / TON Index v3): accounts, transactions, messages, send, runGetMethod, jettons, and NFTs.
About
Reference for the TON HTTP API layer that bridges HTTP requests to TON lite servers, including ton-http-api endpoints and TON Index v3 indexed REST APIs. A developer uses it when reading chain data or sending transactions to TON over HTTP.
- Endpoint groups for accounts, blocks, transactions, send, and runGetMethod
- TON Index v3 adds indexed jettons, NFTs, actions, and multisig endpoints
Ton Http by the numbers
- 4 all-time installs (skills.sh)
- Ranked #347 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
- Data as of Jul 13, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hairyf/blockchain-skills --skill ton-httpAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 4 |
|---|---|
| repo stars | ★ 4 |
| Last updated | February 25, 2026 |
| Repository | hairyf/blockchain-skills ↗ |
What it does
Query TON via the TON Center HTTP API (ton-http-api / TON Index v3): accounts, transactions, messages, send, runGetMethod, jettons, and NFTs.
Files
Based on ton-http-api (sources/ton-http) and TON Index (Go) v3. For request parameters and return values of any endpoint, use Swagger UI or OpenAPI doc.json.
TON nodes use ADNL binary transport; an HTTP API is an intermediary that accepts HTTP and talks to TON lite servers (via tonlib). Use the public toncenter.com or run your own instance from the ton-http-api repo. TON Index v3 (at toncenter.com) adds indexed REST APIs (accounts, actions, jettons, NFTs, etc.) on top of stored chain data.
Looking up endpoint parameters and return values
- Swagger UI (recommended): https://toncenter.com/api/v3/index.html#/ — browse by group, inspect query/body and response schemas.
- OpenAPI JSON: https://toncenter.com/api/v3/doc.json — full machine-readable spec for parameters and models.
When calling or wrapping TON Center APIs, consult the above to confirm query/body parameters and response shapes.
Core References
| Topic | Description | Reference |
|---|---|---|
| API groups and Swagger | Group list, base URL, where to look up params and return values | core-api-overview |
| Deployment and configuration | Run locally or with Docker; webserver, tonlib, and cache env vars | core-deployment-config |
API groups (quick reference)
From ton-http-api (sources/ton-http)
| Tag | Description | Example endpoints |
|---|---|---|
| accounts | Address info, wallet, balance, state, transactions, pack/unpack, token data | GET /getAddressInformation, GET /getWalletInformation, GET /getTransactions, GET /getAddressBalance, GET /getAddressState, GET /packAddress, GET /unpackAddress, GET /getTokenData, GET /detectAddress |
| blocks | Masterchain, shards, block lookup, block transactions, block header | GET /getMasterchainInfo, GET /shards, GET /lookupBlock, GET /getBlockTransactions, GET /getBlockHeader, GET /getShardBlockProof, GET /getConsensusBlock |
| transactions | Locate transactions by message | GET /tryLocateTx, GET /tryLocateResultTx, GET /tryLocateSourceTx |
| get config | Config param, libraries | GET /getConfigParam, GET /getLibraries |
| run method | Run get-method on contract | POST /runGetMethod |
| send | Send BOC/query, estimate fee | POST /sendBoc, POST /sendBocReturnHash, POST /sendQuery, POST /estimateFee |
| json rpc | All methods via JSON-RPC | POST /jsonRPC |
From TON Index v3 (toncenter.com)
| Group | Description | Example endpoints |
|---|---|---|
| accounts | Account states, address book, metadata, wallet states | /api/v3/accountStates, /api/v3/addressBook, /api/v3/metadata, /api/v3/walletStates |
| actions | Actions and traces | /api/v3/actions, /api/v3/traces, /api/v3/pendingActions, /api/v3/pendingTraces |
| api/v2 | Address info, estimate fee, send message, runGetMethod, wallet info | /api/v3/addressInformation, POST /api/v3/estimateFee, POST /api/v3/message, POST /api/v3/runGetMethod, /api/v3/walletInformation |
| blockchain | Blocks, transactions, messages, masterchain | /api/v3/blocks, /api/v3/transactions, /api/v3/messages, /api/v3/masterchainInfo, etc. |
| utils | Decode | GET/POST /api/v3/decode |
| dns | TON DNS | GET /api/v3/dns/records |
| jettons | Jetton masters, wallets, transfers, burns | /api/v3/jetton/masters, /api/v3/jetton/wallets, /api/v3/jetton/transfers, /api/v3/jetton/burns |
| multisig | Multisig wallets and orders | /api/v3/multisig/wallets, /api/v3/multisig/orders |
| nfts | NFT collections, items, transfers | /api/v3/nft/collections, /api/v3/nft/items, /api/v3/nft/transfers |
| stats | Top accounts by balance | /api/v3/topAccountsByBalance |
| vesting | Vesting contracts | /api/v3/vesting |
External links
Generation Info
- Source:
sources/ton-http(toncenter/ton-http-api) - Git SHA:
c5b4a4b7a26c331d94394d2552673213a5dec83a - Generated: 2026-02-25
- Additional reference: TON Index v3 Swagger — https://toncenter.com/api/v3/index.html#/, https://toncenter.com/api/v3/doc.json
TON HTTP API overview
The TON HTTP API is an intermediary: it receives HTTP requests and talks to TON lite servers via tonlib. You can use the public toncenter.com or run your own instance from ton-http-api. TON Index v3 (hosted at toncenter.com) adds indexed REST APIs over stored chain data (accounts, actions, jettons, NFTs, traces, etc.).
Looking up request parameters and return values (for agents)
Before calling or wrapping any TON Center / TON Index endpoint, use one of these to confirm request parameters and response shape:
| Resource | URL | Use |
|---|---|---|
| Swagger UI | https://toncenter.com/api/v3/index.html#/ | Browse by group; see query/body and response schemas and models |
| OpenAPI JSON | https://toncenter.com/api/v3/doc.json | Full OAS 2.0 spec for programmatic use |
Base URL example: https://toncenter.com. For self-hosted ton-http-api, use your server and port (and optional root path, e.g. /api/v2).
API groups and example endpoints
ton-http-api (sources/ton-http)
Defined in sources/ton-http/ton-http-api/pyTON/main.py. Responses use { "ok": true, "result": ... } or { "ok": false, "error": "..." }. All methods are also exposed via POST /jsonRPC with method and params.
| Tag | Endpoints |
|---|---|
| accounts | GET /getAddressInformation, GET /getExtendedAddressInformation, GET /getWalletInformation, GET /getTransactions, GET /getAddressBalance, GET /getAddressState, GET /packAddress, GET /unpackAddress, GET /getTokenData, GET /detectAddress |
| blocks | GET /getMasterchainInfo, GET /getMasterchainBlockSignatures, GET /getShardBlockProof, GET /getConsensusBlock, GET /lookupBlock, GET /shards, GET /getBlockTransactions, GET /getBlockTransactionsExt, GET /getBlockHeader |
| transactions | GET /tryLocateTx, GET /tryLocateResultTx, GET /tryLocateSourceTx |
| get config | GET /getConfigParam, GET /getLibraries |
| run method | POST /runGetMethod (address, method, stack; optional seqno) |
| send | POST /sendBoc, POST /sendBocReturnHash, POST /sendQuery, POST /estimateFee |
| json rpc | POST /jsonRPC |
Address parameters accept any form (raw or user-friendly); use seqno for historical state when supported.
TON Index v3 (toncenter.com)
| Group | Example endpoints |
|---|---|
| accounts | GET /api/v3/accountStates, GET /api/v3/addressBook, GET /api/v3/metadata, GET /api/v3/walletStates |
| actions | GET /api/v3/actions, GET /api/v3/pendingActions, GET /api/v3/traces, GET /api/v3/pendingTraces |
| api/v2 | GET /api/v3/addressInformation, POST /api/v3/estimateFee, POST /api/v3/message, POST /api/v3/runGetMethod, GET /api/v3/walletInformation |
| blockchain | GET /api/v3/blocks, GET /api/v3/transactions, GET /api/v3/messages, GET /api/v3/masterchainInfo, GET /api/v3/adjacentTransactions, GET /api/v3/transactionsByMessage, etc. |
| utils | GET/POST /api/v3/decode |
| dns | GET /api/v3/dns/records |
| jettons | GET /api/v3/jetton/masters, GET /api/v3/jetton/wallets, GET /api/v3/jetton/transfers, GET /api/v3/jetton/burns |
| multisig | GET /api/v3/multisig/wallets, GET /api/v3/multisig/orders |
| nfts | GET /api/v3/nft/collections, GET /api/v3/nft/items, GET /api/v3/nft/transfers |
| stats | GET /api/v3/topAccountsByBalance |
| vesting | GET /api/v3/vesting |
Exact query/body fields and response models (e.g. Transaction, Message, JettonTransfer, NFTItem) are in Swagger UI or doc.json.
Usage notes
- Most read endpoints are GET; send, estimateFee, runGetMethod, decode use POST.
- Address format follows TON conventions (raw or friendly); see each endpoint in Swagger for parameter details.
- For authoritative, up-to-date request/response fields, always use the Swagger or doc.json links above.
<!-- Source references:
- sources/ton-http/README.md
- sources/ton-http/ton-http-api/pyTON/main.py
- https://toncenter.com/api/v3/index.html
- https://toncenter.com/api/v3/doc.json
-->
TON HTTP API deployment and configuration
From sources/ton-http (toncenter/ton-http-api). The service receives HTTP and accesses TON lite servers via tonlib. Recommended: x86_64 or arm64; HTTP API only 1 vCPU / 2 GB RAM; with cache 2 vCPUs / 4 GB RAM.
Running the service
Local (experimental): pip install ton-http-api then ton-http-api (mainnet). Not recommended for production. Windows may need OpenSSL 1.1.1 win64.
Docker Compose (recommended): Install Docker and Docker Compose V2. Download configs:
mkdir private
curl -sL https://ton-blockchain.github.io/global.config.json > private/mainnet.json
curl -sL https://ton-blockchain.github.io/testnet-global.config.json > private/testnet.jsonRun ./configure.py to generate .env, then docker-compose build and docker-compose up -d. Use TON_API_LITESERVER_CONFIG=private/testnet.json (or mainnet) before ./configure.py for testnet.
Environment variables (configure.py → .env)
Webserver
| Variable | Default | Description |
|---|---|---|
TON_API_HTTP_PORT | 80 | HTTP port for the API |
TON_API_ROOT_PATH | / | API path prefix (e.g. /api/v2 behind Nginx/Traefik) |
TON_API_WEBSERVERS_WORKERS | 1 | Gunicorn workers; under load use ~ CPU cores / 2 |
TON_API_GET_METHODS_ENABLED | 1 | Enable runGetMethod endpoint |
TON_API_JSON_RPC_ENABLED | 1 | Enable jsonRPC endpoint |
TON_API_LOGS_JSONIFY | 0 | Log in JSON format |
TON_API_LOGS_LEVEL | ERROR | DEBUG, INFO, WARNING, ERROR, CRITICAL |
TON_API_GUNICORN_FLAGS | (empty) | Extra Gunicorn args |
Tonlib
| Variable | Default | Description |
|---|---|---|
TON_API_TONLIB_LITESERVER_CONFIG | docker: private/mainnet.json, local: URL to global config | Lite server config path (Docker: file only) or URL (local) |
TON_API_TONLIB_KEYSTORE | docker: /tmp/ton_keystore, local: ./ton_keystore/ | Tonlib keystore path |
TON_API_TONLIB_PARALLEL_REQUESTS_PER_LITESERVER | 50 | Max parallel requests per liteserver per worker |
TON_API_TONLIB_CDLL_PATH | (empty) | Path to libtonlibjson if built manually |
TON_API_TONLIB_REQUEST_TIMEOUT | 10 | Liteserver request timeout (seconds) |
Cache (Redis)
| Variable | Default | Description |
|---|---|---|
TON_API_CACHE_ENABLED | 0 | Enable Redis cache for liteserver responses |
TON_API_CACHE_REDIS_ENDPOINT | localhost (docker: cache_redis) | Redis host |
TON_API_CACHE_REDIS_PORT | 6379 | Redis port |
TON_API_CACHE_REDIS_TIMEOUT | 1 | Redis timeout |
FAQ (from source)
- Own lite server: Set
TON_API_TONLIB_LITESERVER_CONFIGto a config with your liteserver(s). MyTonCtrl:mytonctrl→installer→clcfsaves config; if behind firewall, set liteserveripto2130706433(127.0.0.1) in that config. - Multiple instances: Clone repo per instance, set unique
TON_API_HTTP_PORTper clone, build and run each. - Update tonlib: Docker:
docker-compose build --no-cache. Local:pip install -U ton-http-api. - No working liteservers: Config may reference blocks already pruned. Backup config and run
./scripts/update_init_block.sh private/mainnet.json(use--testnetfor testnet).
<!-- Source references:
- sources/ton-http/README.md
- https://github.com/toncenter/ton-http-api
-->