TRON RPC Quickstart | ERPC

TRON RPC Quickstart

This guide takes you from zero to your first TRON JSON-RPC response with ERPC.

1. Get Your API Key

You can obtain and check your API key on the ERPC Web Dashboard: ERPC Web Dashboard
Already using ERPC for Solana, Ethereum, or Avalanche? You can use the same RPC key.

2. Make Your First Request

Send a JSON-RPC 2.0 request as an HTTP POST to /jsonrpc, with your API key in the api-key parameter:
bash
curl 'https://edge.erpc.global/tron/jsonrpc?api-key=<YOUR_API_KEY>' --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_blockNumber"
}'
The response returns the latest block number in hexadecimal:
json
{ "jsonrpc": "2.0", "id": 1, "result": "0x..." }
On the Free plan, your account can send one request per 10 seconds, and a request to another chain can also count toward this limit. Wait 10 seconds before sending the next request.
You can check which chain the endpoint serves with eth_chainId:
bash
curl 'https://edge.erpc.global/tron/jsonrpc?api-key=<YOUR_API_KEY>' --header 'Content-Type: application/json' --data '{
  "jsonrpc":"2.0","id":1,
  "method":"eth_chainId"
}'
You can also send your API key as Authorization: Bearer <YOUR_API_KEY>. When both are present, the query parameter is used.

3. Call the TRON HTTP API

On the Free plan, your account can send one request per 10 seconds, and a request to another chain can also count toward this limit. Wait 10 seconds before sending the next request.
The TRON HTTP API paths are served under /wallet/<name> and /walletsolidity/<name>. Send a JSON object as the POST body. This example reads the latest block with an empty object:
bash
curl 'https://edge.erpc.global/tron/wallet/getnowblock?api-key=<YOUR_API_KEY>' --header 'Content-Type: application/json' --data '{}'
Each HTTP API request is metered as one call. The paths that are available are listed in the TRON RPC Endpoint Documentation.

4. Batch Requests

You can send 1 to 100 JSON-RPC calls in a single HTTP request to /jsonrpc. Every call needs its own id, and id values must not repeat within a batch. Each call in a batch is metered as its own call. On the Free plan, send one call per request: a request with two or more calls is answered with HTTP 429.

Next Steps