Skip to Content
APIContractGet Contract Energy Statistics

Get Contract Energy Statistics

1. Overview & Typical Use

Returns historical daily energy consumption statistics for a contract, including energy obtained from staking, energy burned via TRX, and energy provided by the contract deployer.

  • Typical use: contract energy consumption trend analysis, evaluating contract operating costs, understanding energy source distribution.
  • When not to use: to query daily contract analytics (energy, bandwidth, balance, etc.) use “Get Contract Daily Analytics List”.

2. Endpoint & Authentication

GET /api/onecontractenergystatistic

For Base URL and authentication, see Common Network & Authentication.

3. Request

ParameterTypeRequiredDefaultDescription
addressstringYesContract address (Base58, starts with T)
start_timestampintegerNoStart time, millisecond timestamp
end_timestampintegerNoEnd time, millisecond timestamp

4. Response

Top-level

FieldTypeRequiredDescriptionUnit/Precision
totalintegerRequiredNumber of data points
totalEnergyintegerRequiredTotal historical energy consumption
dataarrayRequiredDaily energy statistics array

data[] element

FieldTypeRequiredDescriptionUnit/Precision
dayintegerRequiredDatemillisecond timestamp
total_energyintegerRequiredTotal energy consumed on this day
energyintegerRequiredEnergy consumed from staking/freezing
contract_suppliedintegerRequiredEnergy provided by the contract deployer
trxintegerRequiredEnergy consumed via TRX burning

5. Errors

For HTTP status codes, see Common Errors. Key points for this endpoint:

  • Address is not a contract: returns 200 + data: [], total: 0.
  • Empty result is not an error: when the contract has no energy consumption records, an empty array is returned as a normal response.
Last updated on: