API & Node Access
Connect to the TRON network using native HTTP APIs, Ethereum-compatible JSON-RPC, or high-throughput gRPC endpoints. This guide details managed provider options like TronGrid and Alchemy, along with the specific interfaces required for contract interaction, indexing, and exchange integrations.
TronGrid — Managed Node Access
Section titled “TronGrid — Managed Node Access”TronGrid is TRON’s official managed node service, managed by the TronGrid team. It is the fastest path to a working connection and the equivalent of Infura or Alchemy for Ethereum.
| Network | HTTP / JSON-RPC base URL | gRPC |
|---|---|---|
| Mainnet | https://api.trongrid.io | grpc.trongrid.io:50051 |
| Nile testnet | https://nile.trongrid.io | grpc.nile.trongrid.io:50051 |
| Shasta testnet | https://api.shasta.trongrid.io | grpc.shasta.trongrid.io:50051 |
TronGrid serves the FullNode API, SolidityNode API, and Event Server from a single base URL.
API Keys
Section titled “API Keys”TronGrid enforces rate limits on unauthenticated requests. For production use, register for a free API key at trongrid.io and pass it in your request headers:
// Task: Configure the SDK with a TronGrid Pro API Key for higher rate limits.const tronWeb = new TronWeb({ fullHost: 'https://api.trongrid.io', headers: { 'TRON-PRO-API-KEY': process.env.TRONGRID_API_KEY }, privateKey: process.env.PRIVATE_KEY,});// Task: Make an authenticated HTTP request to the FullNode API.curl -H "TRON-PRO-API-KEY: your_key_here" \ https://api.trongrid.io/wallet/getnowblockThe free tier is sufficient for development and low-volume production use.
Third-Party Node Providers
Section titled “Third-Party Node Providers”Several major infrastructure providers offer TRON node access as a managed service, often with more generous rate limits or geographic distribution than TronGrid.
| Provider | URL |
|---|---|
| Ankr | ankr.com/rpc/tron |
| Alchemy | alchemy.com/docs/reference/tron-api-quickstart |
| QuickNode | quicknode.com/chains/tron |
| GetBlock | getblock.io/nodes/trx |
| Chainstack | chainstack.com/build-better-with-tron |
| Tatum | tatum.io/chains/tron |
| TronQL | tronql.com |
| NOWNodes | nownodes.io/nodes/tron-trx |
All providers expose the same TRON HTTP API surface — swap the fullHost URL in tronweb and your code needs no other changes.
HTTP API
Section titled “HTTP API”The TRON HTTP API follows a REST-like structure. Every endpoint is a POST request with a JSON body.
Common Endpoints
Section titled “Common Endpoints”# Task: Interact with account and transaction endpoints via curl.# Get latest blockcurl -X POST https://api.trongrid.io/wallet/getnowblock
# Get account infocurl -X POST https://api.trongrid.io/wallet/getaccount \ -d '{ "address": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb2Jq", "visible": true }'
# Get account resources (Energy, Bandwidth)curl -X POST https://api.trongrid.io/wallet/getaccountresource \ -d '{ "address": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb2Jq", "visible": true }'
# Broadcast a signed transactioncurl -X POST https://api.trongrid.io/wallet/broadcasttransaction \ -d '{ "transaction": {...} }'
# Get transaction by hashcurl -X POST https://api.trongrid.io/wallet/gettransactionbyid \ -d '{ "value": "transaction_hash_hex" }'
# Get transaction receiptcurl -X POST https://api.trongrid.io/wallet/gettransactioninfobyid \ -d '{ "value": "transaction_hash_hex" }'TronGrid Extended Endpoints
Section titled “TronGrid Extended Endpoints”TronGrid adds developer-friendly endpoints beyond the base FullNode API:
# Task: Query indexed history via the TronGrid v1 API.# Get TRC-20 token transfers for an addresscurl https://api.trongrid.io/v1/accounts/{address}/transactions/trc20
# Get contract eventscurl https://api.trongrid.io/v1/contracts/{contractAddress}/events
# Get account transactionscurl https://api.trongrid.io/v1/accounts/{address}/transactionsThese support pagination via limit, min_timestamp, and max_timestamp query parameters.
JSON-RPC (EVM-Compatible)
Section titled “JSON-RPC (EVM-Compatible)”TRON exposes a JSON-RPC endpoint compatible with Ethereum’s eth_* namespace. This allows EVM tooling — MetaMask, ethers.js, Hardhat — to interact with TRON directly without rewriting for the native API.
# JSON-RPC endpointPOST https://api.trongrid.io/jsonrpc// Task: Use standard EVM libraries (Ethers.js) to query TRON via JSON-RPC.import { JsonRpcProvider } from "ethers"
const provider = new JsonRpcProvider('https://api.trongrid.io/jsonrpc');const blockNumber = await provider.getBlockNumber();For high-throughput applications — indexers, exchange backends, real-time data pipelines — TRON’s gRPC interface is significantly more efficient than HTTP.
# Mainnet gRPCgrpc.trongrid.io:50051 # FullNodegrpc.trongrid.io:50052 # SolidityNode (finalized state only)
# Nile testnet gRPCgrpc.nile.trongrid.io:50051grpc.nile.trongrid.io:50061The protocol buffer definitions are published at github.com/tronprotocol/protocol. The Trident-java SDK wraps the gRPC interface for Java applications.
Choosing the Right Interface
Section titled “Choosing the Right Interface”| Use case | Recommended interface |
|---|---|
| DApp frontend, scripts, general use | tronweb over HTTP |
| Migration from Ethereum EVM tooling | JSON-RPC |
| Java backend applications | Trident-java over gRPC |
| Go backend applications | gotron-sdk |
| High-volume indexing | gRPC directly |
| Contract event monitoring | TronGrid extended API (/v1/contracts/...) |