TronAgg API
What is TronAgg API?
The TronAgg API lets you automate TRON energy purchases at the best price across multiple providers. Your application can programmatically get quotes, purchase energy, and track orders — all through a simple REST API.
Base URL
https://tronagg.ai/api/v1
All endpoints are relative to this base URL.
Authentication
Every request requires an API key in the X-API-Key header. Create one in the TronAgg Dashboard under API Keys.
curl -H "X-API-Key: ta_your_key_here" https://tronagg.ai/api/v1/account
See the Authentication guide for key management, security best practices, and error handling.
Endpoints Overview
The API has four endpoints covering a typical purchase workflow:
| Endpoint | Method | Description |
|---|---|---|
/account | GET | Check your balance, deposit address, and wallet |
/estimate | GET | Get a price quote before buying |
/buy | POST | Purchase energy for a receiver address |
/order/{id} | GET | Track order status and get delegation TX IDs |
Ready to make your first call? Follow the Quickstart for a step-by-step walkthrough, or jump to Code Examples for copy-paste Python and JavaScript snippets.
Error Codes
| Code | Description |
|---|---|
400 | Bad request — check your parameters |
401 | Unauthorized — invalid or missing API key |
402 | Insufficient balance — top up your account |
404 | Resource not found |
422 | Validation error — see detail field for specifics |
429 | Rate limit exceeded — slow down requests |
500 | Server error — retry or contact support |
Rate Limits
The API is rate-limited to ensure fair usage. If you exceed the limit, you'll receive a 429 Too Many Requests response. Wait a few seconds before retrying.
Authentication
- API Key: ApiKeyAuth
API key obtained from your TronAgg Dashboard under API Keys. Keys use the format ta_... and must be passed in the X-API-Key header with every request. Keep your key secret — regenerate it immediately if compromised.
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | X-API-Key |