API Key

Before using TronGrid V1 API, choose the network endpoint and configure an API key. API keys are used for identification, quota management, rate limiting, and security settings.

Before using TronGrid V1 API, confirm the network you want to access and configure an API key for production requests. API keys are used for identification, quota management, rate limiting, and security settings.

TronGrid V1 API covers Mainnet, Shasta Testnet, and Nile Testnet. Data is different across networks, so use the correct endpoint for development, testing, and production.

Network endpoints

NetworkBase URLPurpose
Mainnethttps://api.trongrid.ioMainnet production environment
Shasta Testnethttps://api.shasta.trongrid.ioTestnet development and validation
Nile Testnethttps://nile.trongrid.ioTestnet development and validation

What is an API key

An API key is an access credential assigned by TronGrid. It does not sign transactions for you and does not represent any on-chain account permission. It is used only by TronGrid service-side systems for request identification, quota tracking, and access control.

Production requests should always include an API key. Requests without an API key may be severely rate-limited or rejected. Whether Shasta or Nile access through TronGrid requires an API key depends on the current TronGrid console and service policy.

Create an API key

Log in to the TronGrid console and create a key from the API key list page. Each key has an independent configuration page, where you can adjust quota, rate limits, and security settings according to business needs.

Recommended key separation:

Key typeRecommended use
Development keyLocal development, test scripts, temporary validation
Production backend keyExchanges, wallets, DApp backends, indexers
Read-only analytics keyDashboards, monitoring, AI Agent queries

Do not reuse the same key across unrelated systems. Separate keys make it easier to observe traffic, diagnose abnormal requests, and rotate only the affected key when needed.

Use an API key

Add TRON-PRO-API-KEY to the HTTP request header:

curl --request GET \
  --url 'https://api.trongrid.io/v1/accounts/TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  --header 'TRON-PRO-API-KEY: <your-trongrid-api-key>'

Python example:

import requests

url = "https://api.trongrid.io/v1/accounts/TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
headers = {
    "TRON-PRO-API-KEY": "<your-trongrid-api-key>"
}

response = requests.get(url, headers=headers, timeout=10)
print(response.text)

JavaScript example:

const response = await fetch(
  "https://api.trongrid.io/v1/accounts/TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  {
    headers: {
      "TRON-PRO-API-KEY": "<your-trongrid-api-key>"
    }
  }
);

console.log(await response.json());

Quota, rate limits, and security settings

API keys can also be bound to rate limits and security policies:

SettingDescription
Rate limitsControl how many requests can be sent within a time window
User-Agent allowlistAllow only requests whose User-Agent matches configured values
Origin allowlistAllow browser requests only from configured sites
Contract address allowlistAllow queries or calls only for specified contract addresses
Request API allowlistAllow the key to access only specified API methods
JWTAdd signed-token authentication on top of the API key

Related resources