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
| Network | Base URL | Purpose |
|---|---|---|
| Mainnet | https://api.trongrid.io | Mainnet production environment |
| Shasta Testnet | https://api.shasta.trongrid.io | Testnet development and validation |
| Nile Testnet | https://nile.trongrid.io | Testnet 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 type | Recommended use |
|---|---|
| Development key | Local development, test scripts, temporary validation |
| Production backend key | Exchanges, wallets, DApp backends, indexers |
| Read-only analytics key | Dashboards, 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:
| Setting | Description |
|---|---|
| Rate limits | Control how many requests can be sent within a time window |
| User-Agent allowlist | Allow only requests whose User-Agent matches configured values |
| Origin allowlist | Allow browser requests only from configured sites |
| Contract address allowlist | Allow queries or calls only for specified contract addresses |
| Request API allowlist | Allow the key to access only specified API methods |
| JWT | Add signed-token authentication on top of the API key |
Related resources
- Rate limits — request quotas, 429 / 403 responses, and backoff strategies
- Security settings — User-Agent, Origin, contract address, API method allowlists, and JWT
- TronGrid V1 API overview — V1 API categories and entry points
- TronGrid — TronGrid node service and extension API introduction