Get Contract Daily Analysis Data
1. Overview & Typical Use
Query daily multi-dimensional analysis data for a contract within a specified time range. Use the type parameter to switch among six query types: balance, token transfers, energy consumption, bandwidth consumption, contract calls, and fees.
- Typical use: contract operations dashboard, contract resource consumption analysis, TRX balance change trend for a contract.
- When not to use: for energy statistics only use “Get Contract Energy Statistics”; for call statistics use “Get Contract Call Statistics”.
2. Endpoint & Authentication
GET /api/contract/analysis
For Base URL and authentication, see Common Network & Authentication.
3. Request
Fields
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
address | string | Yes | — | Contract address (Base58, starts with T) |
type | integer | Yes | — | Query data type (see table below) |
start_timestamp | integer | No | — | Start time, millisecond timestamp |
end_timestamp | integer | No | — | End time, millisecond timestamp |
type values:
| Value | Description |
|---|---|
0 | Balance — TRX balance and TRX price for the day |
1 | Token transfers — TRC20 token transfer count and number of token types transferred |
2 | Energy consumption — consumption from frozen TRX, TRX burn, and contract deployer contribution |
3 | Bandwidth consumption — consumption from free bandwidth or frozen TRX, and TRX burn |
4 | Contract calls — call count and number of calling accounts |
5 | Fees — bandwidth and energy consumed via TRX burn |
4. Response
Fields
Top-level
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
size | integer | Required | Number of data records (number of days) | — |
data | array | Required | Daily analysis data array; fields vary by type | — |
data[] elements — type=0 (balance)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
trx_amount | string | Required | TRX balance for the day | TRX |
usdt_amount | string | Required | Equivalent USDT value | USDT |
price | number | Required | TRX/USDT price for the day | — |
data[] elements — type=1 (token transfers)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
transfer_count | integer | Required | Number of transfers | — |
token_count | integer | Required | Number of token types involved | — |
data[] elements — type=2 (energy consumption)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
energy_usage | integer | Required | Energy consumed from staking/freezing | — |
energy_burn | integer | Required | Energy consumed via TRX burn | — |
origin_energy_usage | integer | Required | Energy provided by the contract deployer | — |
energy_usage_total | integer | Required | Total energy consumed (= energy_usage + energy_burn + origin_energy_usage) | — |
energy_usage_as_deploy | integer | Required | Energy consumed for contract deployment | — |
energy_total | integer | Required | Total energy (= energy_usage + energy_burn, excludes origin_energy_usage) | — |
data[] elements — type=3 (bandwidth consumption)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
net_usage | integer | Required | Free/staked bandwidth consumed | — |
net_burn | integer | Required | Bandwidth consumed via TRX burn | — |
net_usage_total | integer | Required | Total bandwidth consumed | — |
data[] elements — type=4 (contract calls)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
trigger_count | integer | Required | Number of calls | — |
account_count | integer | Required | Number of calling accounts | — |
data[] elements — type=5 (fees)
| Field | Type | Required | Description | Unit/Precision |
|---|---|---|---|---|
day | string | Required | Date | YYYY-MM-DD |
burn_trx | string | Required | Fees consumed via TRX burn | TRX |
5. Errors
For HTTP status codes, see Common Errors. Notes for this endpoint:
typevalue out of range 0–5: returns an empty result without error.- No data in the time range: returns
200+data: [],size: 0. - Empty result is not an error: returns an empty array when the contract does not exist or has no data in the time period.
Last updated on: