How to Access Tron API

Step 1: To access Tron, use the following native access endpoints:

  • Network: Tron Mainnet
  • Request Type: POST
https://svc.blockdaemon.com/tron/mainnet/native/jsonrpc
  • Network: Tron Nile Testnet
  • Request Type: POST
https://svc.blockdaemon.com/tron/nile/native/jsonrpc

Step 2: Authenticate your request using your API key. You can include the API key using either of the following headers:

Authorization: Bearer YOUR_API_KEY
X-API-Key: YOUR_API_KEY

Step 3: Specify a Tron method in the request body:

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "YOUR_METHOD",
    "params": []
}

Example Request

Here is a cURL example for using eth_protocolVersion to get the current Ethereum protocol version.

curl --request POST \
  --url https://svc.blockdaemon.com/tron/mainnet/native/jsonrpc \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_protocolVersion",
    "params": []
  }'

The following is a typical response you will get:

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": "0x1e"
}

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.