TronGrid API Guide: TRON Node Access for Developers — TRON Wiki

TronGrid API Guide: TRON Node Access for Developers

10 min read · ⌘K search

TronGrid is the standard way developers access TRON blockchain data without operating a full node. It exposes REST endpoints for account balances, transaction history, contract triggers, and event logs — used directly via HTTP or through TronWeb.

This guide covers setup, authentication, common endpoints, and production best practices.

TronGrid vs self-hosted node

ApproachProsCons
TronGridFast setup, maintained infraRate limits, dependency on provider
Own full nodeNo external limitsOps burden, sync time, hardware

Most applications start on TronGrid; high-volume exchanges often run private nodes.

Registration and API key

  1. Visit https://www.trongrid.io
  2. Create account → Dashboard → Create API Key
  3. Use key in header: TRON-PRO-API-KEY: <your-key>

Without key, aggressive polling may hit throttling.

Endpoints

NetworkBase URL
Mainnethttps://api.trongrid.io
Shasta testnethttps://api.shasta.trongrid.io

TronWeb config:

Code
const tronWeb = new TronWeb({
  fullHost: 'https://api.trongrid.io',
  headers: { 'TRON-PRO-API-KEY': 'your-key' },
});

Common REST operations

Get account info

Code
GET /v1/accounts/{address}

Returns TRX balance, resources (Energy/Bandwidth), and TRC-20 token balances.

See query TRC-20 balance API.

Get transaction by ID

Code
GET /v1/transactions/{txid}

See verify transaction API.

Broadcast transaction

Code
POST /wallet/broadcasttransaction

Body contains signed transaction JSON from TronWeb.

Trigger smart contract

Code
POST /wallet/triggersmartcontract

Used for read/write contract calls — trigger smart contract.

Full reference: TRON HTTP API.

Rate limits and reliability

Production patterns:

  • Cache immutable data (old blocks, confirmed txs)
  • Exponential backoff on 429 responses
  • Multiple API keys per service tier if allowed
  • Webhook/polling hybrid for payment detection

Events and logs

TronGrid supports event plugin queries for contract events — useful for USDT deposit listeners. TronWeb wrapper: event listeners.

Security

  • API keys are secrets — env vars, not frontend bundles
  • Signing transactions server-side only with secured keys
  • Validate addresses before broadcast

Shasta development workflow

  1. Shasta endpoint + test key
  2. Faucet TRX
  3. Deploy contracts via TronBox
  4. Promote to mainnet with new addresses

Production deployment tips

Run multiple API keys across services for quota isolation. Cache immutable data (contract ABIs, verified source). Use exponential backoff on 429 responses. For mission-critical payment detection, consider a dedicated full node or premium TronGrid tier.

Endpoint selection guide

Use /wallet/* for transaction building and broadcast. Use /v1/* for indexed history and events. Mixing them incorrectly — e.g., polling getaccount every second for payment detection instead of events API — wastes quota and adds latency. Map each product feature to the correct endpoint family during design review.

FAQ

What is TronGrid?

TronGrid is TRON's hosted API service providing HTTP access to full node data — accounts, transactions, blocks, and smart contracts without running your own node.

Do I need an API key for TronGrid?

Free tier works with limits. Production apps should register for a TRON-PRO-API-KEY to increase rate limits and reliability.

Is TronGrid the same as TronScan API?

TronScan offers explorer APIs for human-readable data. TronGrid is node-oriented infrastructure from TRON Foundation ecosystem. Many apps use both.

Can TronGrid sign transactions?

No. You sign locally with TronWeb + private key or TronLink; TronGrid broadcasts signed txs.

What happens if TronGrid is down?

Implement retries, status page monitoring, and consider fallback full node for critical systems.