How to Get a TRON RPC Endpoint
Step-by-step guide to getting a fast, reliable TRON RPC endpoint
Step-by-Step: Get Your TRON RPC Endpoint
Code Sample
import TronWeb from "tronweb";
const tronWeb = new TronWeb({
fullHost: "https://go.getblock.io/<YOUR-ACCESS-TOKEN>/",
});
// Get TRX balance
const balance = await tronWeb.trx.getBalance("TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g");
console.log(`Balance: ${balance / 1e6} TRX`);
// Get USDT balance (TRC-20)
const contract = await tronWeb.contract().at("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"); // USDT
const usdtBalance = await contract.balanceOf("TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g").call();
console.log(`USDT: ${usdtBalance / 1e6}`);import requests
url = "https://go.getblock.io/<YOUR-ACCESS-TOKEN>/"
# Get latest block
response = requests.post(f"{url}wallet/getnowblock")
block = response.json()
print(f"Block: {block['block_header']['raw_data']['number']}")
# Get account info
response = requests.post(f"{url}wallet/getaccount", json={
"address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"visible": True
})
print(f"Balance: {response.json().get('balance', 0) / 1e6} TRX")TRON API Interfaces
Interface
Use Case
What's Next?
Last updated
Was this helpful?

