GET
/
api
/
tron
/
gas
/
estimate
curl -X GET \
'https://openapi.gasstation.ai/api/tron/gas/estimate?app_id=49e9c57da66788e5178c8fec2905067b&data=lgy/X0LwFTE/03yBGP0PIGgzZMY+KFzlOFAo0SZkChygmN8RnV+y1tTEbjTAR2SD04xSX+r9FKWqIaATxev6yQ=='
{
    "code": 0,
    "msg": "Success",
    "data": {
        "contract_address": "TED4rvM5VAG8kzKULTb7GXXY6ph9aTwjt3",
        "address_to": "TE4Smnqa4cWiKZdmjzD64peEqLFqk213HS",
        "receive_address": "TXxtczsXf1EYgWEbwSxwC85iMfdv6CGNRa",
        "amount": "1.216000",
        "energy_amount": "1.216000",
        "active_amount": "0",
        "energy_num": 32000,
        "energy_price": "38.00000001",
        "service_charge_type": "10010"
    }
}

The current API estimates only TRON Energy costs; it does not include Net (bandwidth) costs.

The following estimation scenarios are supported:

  • Standard token transfers: Do not provide amount or data.
  • Contract invocation transactions: Provide the ABI-encoded data (in hex format).

Request Parameters

receive_address
string
required

receive addres

Please ensure that the received address holds the token corresponding to the contracted_address, otherwise the miner fee estimation will fail

address_to
string
required

The transfer address for estimating miner fees.

  • Standard token transfer scenario: address_to is the actual recipient address.
  • Contract invocation transaction scenario: address_to is the contract address, and it must match contract_address.
contract_address
string
required

Contract address for estimating miner fees.

service_charge_type
string
required

rent time code: Request the order/price interface to return the cost codes for minutes, hours, days, and different times.

eg:10010 - 10 minutes, 20001 - 1 hour, 30001 - 1 day

amount
string

Contract invocation amount

When used for contract estimation scenarios, amount represents the value associated with the contract invocation. This parameter is optional for standard transfer estimation scenarios.

data
string

Contract invocation data; hexadecimal data constructed via ABI encoding.

If data is provided, the API treats the request as a contract transaction for resource estimation; this parameter is optional for standard transfer estimation scenarios.

Response Parameters

curl -X GET \
'https://openapi.gasstation.ai/api/tron/gas/estimate?app_id=49e9c57da66788e5178c8fec2905067b&data=lgy/X0LwFTE/03yBGP0PIGgzZMY+KFzlOFAo0SZkChygmN8RnV+y1tTEbjTAR2SD04xSX+r9FKWqIaATxev6yQ=='
{
    "code": 0,
    "msg": "Success",
    "data": {
        "contract_address": "TED4rvM5VAG8kzKULTb7GXXY6ph9aTwjt3",
        "address_to": "TE4Smnqa4cWiKZdmjzD64peEqLFqk213HS",
        "receive_address": "TXxtczsXf1EYgWEbwSxwC85iMfdv6CGNRa",
        "amount": "1.216000",
        "energy_amount": "1.216000",
        "active_amount": "0",
        "energy_num": 32000,
        "energy_price": "38.00000001",
        "service_charge_type": "10010"
    }
}