GET /estimate
Returns TRONAgg's current price for resource_amount Energy delivered for 1 hour — what POST /buy would charge your balance right now (your VIP price if you have one).
Parameters:
resource_amount— amount of Energy to buy (in Energy units, not TRX)receiver_address(optional) — the address that will receive the Energy. Pass it to include the one-time account-activation fee when the address is not yet activated on TRON. Without it the quote leaves that fee out, whilePOST /buystill charges it.
The response includes the unit price in SUN, the total cost, any activation fee, and the order-size limits (min_amount / max_amount). Use it to preview costs before committing to a purchase.
Parameters
resource_amountintegerqueryrequired> 0Amount of Energy to quote, in Energy units (not TRX).
POST /buyaccepts amounts betweenmin_amountandmax_amountfrom this response.resource_type"ENERGY" | "BANDWIDTH"queryoptionaldefault ENERGYResource to quote:
ENERGY(default) orBANDWIDTH. Any other value returns400 unsupported_resource.receiver_addressstringqueryoptionalAddress that will receive the Energy. When it is not yet activated on TRON, the one-time activation fee is added to the totals and returned in
activation_fee_sun.
Response 200
durationstringRental duration — always
1h.unit_price_sunstringPrice per Energy unit in SUN, as a decimal string. It can be fractional — parse it with a decimal type, not as an integer.
total_price_sunintegerTotal your balance would be charged, in SUN — includes
activation_fee_sun.total_price_trxstringThe same total in TRX (decimal string).
activation_fee_sunintegerOne-time account-activation fee in SUN, included in the totals. Non-zero only when you pass a
receiver_addressthat is not yet activated on TRON.activation_fee_trxstringThe activation fee in TRX (decimal string);
"0"when there is none.min_amountintegernullableSmallest
resource_amountPOST /buyaccepts;null= no lower bound. Outside the boundsPOST /buyreturns400.max_amountintegernullableLargest
resource_amountPOST /buyaccepts;null= no upper bound. Outside the boundsPOST /buyreturns400.energy_pass_energyintegerEnergy units your Energy Pass would cover right now; the totals are what your balance pays for the rest.
0without an active Energy Pass.
Status codes
200400401403422429503
200StatusOK
400Statusunsupported_resourceorinvalid_duration— an unknownresource_type, or adurationother than1h.401StatusThe
X-API-Keyheader is missing, invalid or revoked.detailis a plain string:API key required,Invalid API keyorUser not found.403StatusThe account is blocked (plain-string
detail:Account is blocked), orip_not_allowed— the request's source IP is outside this key's IP allowlist.422StatusRequest validation failed (e.g.
resource_amountmissing or not above 0) —detailis an array of field errors.429StatusRate limit exceeded— more than 1,000 requests per minute for your account (shared by all of its API keys and workspace sessions).detailis a plain string; wait the number of seconds inRetry-After, then retry.503Statusservice_unavailable— purchasing is temporarily unavailable.
curl -s -G https://tronagg.ai/api/v1/estimate \
-d resource_amount=65000 \
-d receiver_address=TYourReceiverAddress \
-H "X-API-Key: $TRONAGG_API_KEY"const params = new URLSearchParams({
resource_amount: "65000",
receiver_address: "TYourReceiverAddress",
});
const res = await fetch(`https://tronagg.ai/api/v1/estimate?${params}`, {
headers: { "X-API-Key": process.env.TRONAGG_API_KEY },
});
console.log(res.status, await res.json());import os
import requests
res = requests.get(
"https://tronagg.ai/api/v1/estimate",
headers={"X-API-Key": os.environ["TRONAGG_API_KEY"]},
params={
"resource_amount": 65000,
"receiver_address": "TYourReceiverAddress",
},
)
print(res.status_code, res.json()){
"duration": "<string>",
"unit_price_sun": "<string>",
"total_price_sun": <integer>,
"total_price_trx": "<string>",
"activation_fee_sun": <integer>,
"activation_fee_trx": "<string>",
"min_amount": <integer> | null,
"max_amount": <integer> | null,
"energy_pass_energy": <integer>
}