Complete TON API guide for developers. Learn to use Toncoin RPC, query blockchain data, and interact with smart contracts.">
Developer documentation for TON (Toncoin) blockchain API. RPC endpoints, data queries, and integration.
The Open Network (TON) is a fast, scalable blockchain originally developed by Telegram. It offers high throughput and low fees for decentralized applications.
https://toncenter.com/api/v2/jsonRPChttps://tonapi.io
import requests
url = "https://toncenter.com/api/v2/jsonRPC"
data = {
"jsonrpc": "2.0",
"method": "getBlock",
"params": {"seqno": 12345678},
"id": 1
}
response = requests.post(url, json=data)
print(response.json())
import requests
url = "https://tonapi.io/v2/accounts/{address}/balance"
# Replace with actual address
address = "EQCD39VS5jcptHL8vMjEXrzEqr5f6yXRAxyy43pZNL2u"
response = requests.get(url.replace("{address}", address))
print(response.json())
import requests
url = "https://tonapi.io/v2/accounts/{address}/transactions"
address = "EQCD39VS5jcptHL8vMjEXrzEqr5f6yXRAxyy43pZNL2u"
response = requests.get(url.replace("{address}", address))
data = response.json()
print(data["transactions"][:5]) # Last 5 transactions
import requests
from pytonlib import Tonlib
# Using pytonlib library
client = Tonlib(ls_index=0)
# Transfer TON
result = client.transfer(
wallet_mnemonic=["word1", "word2", ...],
destination="EQ...",
amount=1_000_000_000 # in nanoTON
)
print(result["hash"])