Tezos API
API Endpoints
Mainnet: https://api.tzstats.com
Mainnet Staging: https://api.staging.tzstats.com
Delphinet: https://api.delphi.tzstats.com
Edonet: https://api.edo.tzstats.com
TzStats provides a powerful Tezos API to access fully indexed raw data and statistics collected from the Tezos blockchain. Made and supported by Blockwatch Data. You may use this API free of charge and without limits for non-commercial projects. To inquire about commercial use send an email to license@blockwatch.cc.
This API reference provides information on all public API endpoints and the different schemes of calling them. Access to the API does not require authentication and we do not enforce rate limits right now, but we monitor usage and may apply limits later to guarantee fair usage for everybody.
The API supports three different endpoint flavors to access the same underlying data in different ways:
- explorer endpoints for accessing individual objects
- table endpoints for accessing large collections of rows
- time-series endpoints for aggregate counters and statistics over specific fields
Calling the API
Our Tezos API is read-only at the moment, i.e. the only supported HTTP methods are GET
, HEAD
and OPTIONS
. Query parameters must be properly URL encoded and appended as query arguments.
For high-speed high-volume access, always use the table API endpoints. Table and time-series endpoints stream data and have higher limits, that is, they immediately return response headers after accepting and validating a request and then stream rows or aggregated data points as they are fetched from the underlying database.
Transport Security
All our certificates are signed by LetsEncrypt Authority X3 certificate.
Available ciphers are
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-ECDSA-CHACHA20-POLY1305
ECDHE-ECDSA-AES128-GCM-SHA256
ECDHE-ECDSA-AES256-SHA384
ECDHE-ECDSA-AES128-SHA256
ECDHE-RSA-AES256-GCM-SHA384
ECDHE-RSA-CHACHA20-POLY1305
ECDHE-RSA-AES128-GCM-SHA256
ECDHE-RSA-AES256-SHA384
ECDHE-RSA-AES128-SHA256
The API supports secure connections via TLS v1.3, v1.2 and v1.1 with Perfect Forward Secrecy based on Elliptic Curves and Diffie Helman key exchange. Insecure HTTP requests to port 80 are automatically redirected to HTTPS on port 443.
Tezos API Response Headers
All our API responses are tagged with an API version that’s included in the X-Api-Version
HTTP header field as well as the Tezos network id and protocol.
Current TzStats Mainnet Response Headers
# API version
X-Api-Version: v008-2021-02-10
# Tezos Network (chain id)
X-Network-Id: NetXdQprcVkpaWU
# Tezos Protocol (protocol hash)
X-Protocol-Hash: PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS
CORS
TzStats Data API supports cross-origin HTTP requests, commonly referred as CORS. This means that you can call the API using Javascript from any browser. Right now CORS support is limited to localhost and the tzstats.com domain. Send a request to tzstats@blockwatch.cc if you have an interesting use case and like to get whitelisted.
Rate Limits
We do not enforce limits on the number of calls or the amount of data you can query from the API. We do, however, use SPAM protection measures that limit the number of connection attempts and HTTP calls over short time-frames. Try to slow down your call rate if you start seeing 429 status codes. Be responsible with calls and retries, this API is a shared resource for everybody.
Data Formats
Regular JSON Objects
{
"hash": "BLPUNqkikFAbNDekUhiqJrCaao86o6sPNq5YrcGobHMzSPi4XWr",
"predecessor": "BM6xrDirVQLYf5KkU7ZFbTdhzxe8Hn9k2K1rR7bmByfcv75dzcu",
"baker": "tz1XfAjZyaLdceHnZxbMYop7g7kWKPut4PR7",
"height": 626158,
"cycle": 152
}
JSON Bulk Arrays
[
[
"BMRdcMqU63QiXmU8vLE7a2qBES1kRX46mTDEGYEUsFV8uL4PDkd",
"tz1isXamBXpTUgbByQ6gXgZQg4GWNW7r6rKE",
626160,
152
],[
"BLhhgCSR8Avhbc7hrqQ9uSsB9Adfts2NwqZbzrGS5VCjxQdLX5N",
"tz1coHzgoQYRu1Ezn5QChfFEjwTrBzGNQT6U",
626159,
152
],[
"BLPUNqkikFAbNDekUhiqJrCaao86o6sPNq5YrcGobHMzSPi4XWr",
"tz1XfAjZyaLdceHnZxbMYop7g7kWKPut4PR7",
626158,
152
]
]
Results are returned as Content-Type
JSON (RFC 7159) or CSV (RFC 4180). Select either format by appending .json
or .csv
to the query path.
CSV files always include a header containing the requested column names in the requested order. Columns are separated by comma (ASCII 44, UTF-8 0x2C).
When downloading a CSV file you may add an optional filename
query argument (ASCII only, 128 characters max, no path separators) which will be used in the Content-Disposition header. Suffix .csv
isautomatically appended if missing.
JSON Bulk Arrays
Large JSON results such as lists and time-series use a more optimized (less verbose) formatting. Instead of regular JSON objects with named key/value pairs we use bulk arrays, i.e. two levels of nested JSON arrays without keys. An outer array contains result rows or datapoints. The inner arrays contain lists of columns. To control which columns are returned and their order use the columns
query parameter.
Note: As we keep adding new fields to tables and time-series the default order of JSON bulk arrays may change over time. To ensure that our API always returns the field order you expect, use the columns
query argument. The order of columns you specify is exactly the order that’s returned.
JSON Data Types
We use the following data types and encoding conventions throughout the API:
string | unstructured ASCII/UTF-8 text |
bytes | binary data encoded |
datetime | UTC timestamps as UNIX milliseconds, e.g. 1536246000000 or ISO 8601/RFC3339 strings 2018-09-06T15:00:00Z |
duration | signed 64bit integers with second precision |
boolean | a binary value, either as string or number true (1) or false (0) |
float64 | an IEEE-754 64-bit floating-point number |
int64 | a signed 64-bit integer (Range: -9,223,372,036,854,775,807 through 9,223,372,036,854,775,807) |
uint64 | an unsigned 64-bit integer (Range: 0 through 18,446,744,073,709,551,615) |
enum | enumerable values expressed as strings, usually used for types |
hash | on-chain hashes encoded as base58-check strings |
money | monetary quantities are expressed as float64 with 6 decimal points (the Tezos coin unit precision); market endpoints use 5 or more decimal points depending on the fiat or crypto pairs |
For efficiency reasons, timestamps in JSON bulk arrays are encoded as UNIX time at millisecond resolution. That is, value 0
represents Jan 1, 1970 00:00:00 UTC
. Timestamps in explorer responses and CSV output are encoded according to RFC 3339 (2018-09-06T08:07:38Z
) for convenience and human readability.
Timestamps in queries can be expressed in multiple ways:
- as RFC3339 string with any timezone
- as UNIX timestamp in seconds or milliseconds, so
1536246000
and1536246000000
are equal - as date without time, i.e.
2018
,2018-09
,2018-09-06
represents midnight at the first day of month and/or month of year - as static string such as
now
,today
, oryesterday
to reference a relative point in time - as static string expression with truncation and offset arguments against
now
, eg.now/d
for start of today ornow/d-30d
for start of day 30 days ago (expressions supports
,m
,h
,d
)
Status Codes
The TzStats Data API responds with regular HTTP status codes in the 2xx
range to indicate success, in the 4xx
range to indicate client-side errors and in the 5xx
range to indicate backend errors. The response body contains additional information encoded as JSON object.
200 OK
Success400 Bad Request
Missing required fields of malformed request data, your fault404 Not Found
No such object405 Method Not Allowed
Unsupported request method409 Conflict
Resource state conflict429 Too Many Requests
Request limit exceeded500 Internal Server
Something went wrong, not your fault502 Bad Gateway
Your request has reached a timeout and was cancelled, try to reduce the range of data in your request504 Gateway Timeout
Our backend is overloaded or down for maintenance, wait a while before retry
Error Responses
API Error Response
{
"errors": [
{
"code": 1007,
"status": 400,
"message": "incorrect request syntax",
"scope": "StreamTable",
"detail": "unknown column 'cycles'",
"request_id": "BW-a935b7fedf6beefcedc94e539cfe320cc551c5b3",
}
]
}
All error messages are JSON encoded. They contain fields numeric and human readable fields to help developers easily debug and map errors.
Fields | Description |
---|---|
status int |
The HTTP status code, duplicated for convenience. |
message string |
A textual representation of the error status. |
scope string |
The name of the API call that has failed. |
detail string |
A detailed text description of the error. |
code int |
An internal error code. |
request_id string |
Unique call id that helps us trace failed requests. |
Explorer Endpoints
Explorer endpoints serve individual large JSON objects and a few related lists. JSON objects use the typical JSON key/value structure and you cannot limit the contents of objects (i.e. they are always sent in full). CSV format is not supported here.
Most explorer endpoints take different kinds of path arguments to define the object to return. This can be:
- a regular
hash
for blocks, operations or accounts - the string
head
for the most recent object on the blockchain (e.g. the recent block or cycle) - a block
height
(a.k.a level in Tezos) - a sequence
number
for cycles and elections
Some endpoints support a simple pagination scheme to walk lists of results (i.e. for related operations or accounts). To paginate append limit
and offset
, both are positive integers. Limit defaults to 20 and is capped to a maximum value of 100. Results are always sorted by row_id
of the underlying table. Sort direction can be controlled by order
(asc, or desc). If you require sorting by a different field, you have to do this client-side.
List of supported endpoints
Endpoint | Is Paged | Filter | Comment |
---|---|---|---|
GET /explorer/status |
indexer status | ||
GET /explorer/config/{id} |
blockchain config at head or height |
||
GET /explorer/tip |
blockchain tip info | ||
GET /explorer/protocols NEW |
list of deployed protocols | ||
GET /explorer/metadata NEW |
account metadata | ||
GET /explorer/bakers NEW |
baker list | ||
GET /explorer/block/{id} |
block info at head , hash , of height |
||
GET /explorer/block/{id}/op LEGACY |
x | type |
list block operations at head , hash , or height |
GET /explorer/block/{id}/operations |
x | type |
list block operations at head , hash , or height |
GET /explorer/op/{hash} |
operation info | ||
GET /explorer/account/{hash} |
account info | ||
GET /explorer/account/{hash}/contracts RENAMED |
x | list of contracts managed by this account | |
GET /explorer/account/{hash}/op LEGACY |
x | type , block , since |
account info with embedded list of related operations |
GET /explorer/account/{hash}/operations |
x | type , block , since |
account info with embedded list of related operations |
GET /explorer/account/{hash}/ballots |
x | list proposals and ballots | |
GET /explorer/contract/{hash} |
smart contract metadata | ||
GET /explorer/contract/{hash}/calls |
x | block , since , entrypoint |
list contract calls |
GET /explorer/contract/{hash}/creator RENAMED |
contract creator (a.k.a. manager) | ||
GET /explorer/contract/{hash}/script |
smart contract code, storage and parameter spec | ||
GET /explorer/contract/{hash}/storage |
smart contract storage | ||
GET /explorer/bigmap/{id} |
bigmap metadata | ||
GET /explorer/bigmap/{id}/type |
bigmap type specification | ||
GET /explorer/bigmap/{id}/keys |
x | list of bigmap keys | |
GET /explorer/bigmap/{id}/values |
x | list of bigmap key/value pairs | |
GET /explorer/bigmap/{id}/updates |
x | list of bigmap updates | |
GET /explorer/bigmap/{id}/{key} |
single bigmap value | ||
GET /explorer/bigmap/{id}/{key}/updates |
x | list of bigmap updates related to a key | |
GET /explorer/cycle/{id} |
cycle info for head or cycle |
||
GET /explorer/election/{id} |
election metadata and results at head , num or protocol hash |
||
GET /explorer/election/{id}/{stage}/voters |
x | election voter lists | |
GET /explorer/election/{id}/{stage}/ballots |
x | election ballots lists | |
GET /explorer/rank/balances |
x | accounts ranked by balance | |
GET /explorer/rank/volume |
x | accounts ranked by 1D transaction volume | |
GET /explorer/rank/traffic |
x | accounts ranked by 1D traffic | |
GET /markets |
list of known exchanges and markets | ||
GET /markets/tickers |
list of 1D market tickers | ||
GET /markets/{exchange} |
exchange status | ||
GET /markets/{exchange}/{market} |
market status | ||
GET /markets/{exchange}/{market}/ticker |
single market ticker |
Accounts
Example request for baker accounts.
curl "https://api.tzstats.com/explorer/account/tz3RDC3Jdn4j15J7bBHZd29EUee9gVB1CxD9"
Example response for baker accounts.
{
"address": "tz3RDC3Jdn4j15J7bBHZd29EUee9gVB1CxD9",
"address_type": "p256",
"delegate": "tz3RDC3Jdn4j15J7bBHZd29EUee9gVB1CxD9",
"pubkey": "p2pk67wVncLFS1DQDm2gVR45sYCzQSXTtqn3bviNYXVCq6WRoqtxHXL",
"first_in": 30,
"first_out": 4097,
"last_in": 1342841,
"last_out": 1342841,
"first_seen": 1,
"last_seen": 1342841,
"delegate_since": 1,
"first_in_time": "2018-06-30T18:11:27Z",
"first_out_time": "2018-07-03T14:17:12Z",
"last_in_time": "2021-02-13T10:02:55Z",
"last_out_time": "2021-02-13T10:02:55Z",
"first_seen_time": "2018-06-30T17:39:57Z",
"last_seen_time": "2021-02-13T10:02:55Z",
"delegate_since_time": "2018-06-30T17:39:57Z",
"total_received": 3199080.326956,
"total_sent": 3000000,
"total_burned": 0,
"total_fees_paid": 0.044374,
"total_rewards_earned": 3983406.864835,
"total_fees_earned": 1034.319477,
"total_lost": 0,
"frozen_deposits": 2060800,
"frozen_rewards": 61046.916177,
"frozen_fees": 47.928321,
"spendable_balance": 2061626.622397,
"total_balance": 4122474.550718,
"delegated_balance": 18921017.973163,
"total_delegations": 14,
"active_delegations": 9,
"is_funded": true,
"is_activated": true,
"is_delegated": false,
"is_revealed": true,
"is_delegate": true,
"is_active_delegate": true,
"is_contract": false,
"blocks_baked": 54686,
"blocks_missed": 590,
"blocks_stolen": 1349,
"blocks_endorsed": 937695,
"slots_endorsed": 1660562,
"slots_missed": 60304,
"n_ops": 940181,
"n_ops_failed": 0,
"n_tx": 69,
"n_delegation": 0,
"n_origination": 0,
"n_proposal": 0,
"n_ballot": 11,
"token_gen_min": 1,
"token_gen_max": 43238,
"grace_period": 333,
"staking_balance": 23043492.523881,
"staking_capacity": 44530768.468665,
"rolls": 2880,
"last_bake_height": 1342802,
"last_bake_block": "BLyPLQZ19VpVrAKfYd7fBfucjUFxbH8cPEKsudyBM1uJByMt315",
"last_bake_time": "2021-02-13T09:23:55Z",
"last_endorse_height": 1342841,
"last_endorse_block": "BLnw18a8buAJFFNtxkizMm4Bg7oRst3eaUebYBAEeUSRRDZdfLg",
"last_endorse_time": "2021-02-13T10:02:55Z",
"next_bake_height": 1342857,
"next_bake_priority": 0,
"next_bake_time": "2021-02-13T10:18:55Z",
"next_endorse_height": 1342843,
"next_endorse_time": "2021-02-13T10:04:55Z",
"avg_luck_64": 10055,
"avg_performance_64": 9889,
"avg_contribution_64": 9970,
"baker_version": "08c80261"
}
Example request for non-baker accounts and contracts.
curl "https://api.tzstats.com/explorer/account/KT1QuofAgnsWffHzLA7D78rxytJruGHDe7XG"
Example response for non-baker accounts and contracts.
{
"address": "KT1QuofAgnsWffHzLA7D78rxytJruGHDe7XG",
"address_type": "contract",
"delegate": "tz3RDC3Jdn4j15J7bBHZd29EUee9gVB1CxD9",
"creator": "KT1QuofAgnsWffHzLA7D78rxytJruGHDe7XG",
"pubkey": "",
"first_in": 30,
"first_out": 30,
"last_in": 984007,
"last_out": 984007,
"first_seen": 1,
"last_seen": 984056,
"delegated_since": 1,
"first_in_time": "2018-06-30T18:11:27Z",
"first_out_time": "2018-06-30T18:11:27Z",
"last_in_time": "2020-06-05T19:25:32Z",
"last_out_time": "2020-06-05T19:25:32Z",
"first_seen_time": "2018-06-30T17:39:57Z",
"last_seen_time": "2020-06-05T20:14:32Z",
"delegated_since_time": "2018-06-30T17:39:57Z",
"total_received": 0,
"total_sent": 2822843.928521,
"total_burned": 0,
"total_fees_paid": 0,
"unclaimed_balance": 6731138.546637,
"spendable_balance": 0,
"total_balance": 0,
"is_funded": true,
"is_activated": false,
"is_delegated": true,
"is_revealed": false,
"is_delegate": false,
"is_active_delegate": false,
"is_contract": true,
"n_ops": 31,
"n_ops_failed": 0,
"n_tx": 31,
"n_delegation": 0,
"n_origination": 0,
"token_gen_min": 1,
"token_gen_max": 1
}
Provides information about the most recent state of accounts and smart contracts. Baker accounts and delegator accounts contain additional state information. Use meta
(boolean) to embed optional metadata. See the table below for details.
HTTP Request
GET https://api.tzstats.com/explorer/account/{hash}
HTTP Response
Field | Description |
---|---|
address hash |
Account address as base58-check encoded string. |
address_type enum |
Account address type ed25519 (tz1), secp256k1 (tz2), p256 (tz3), contract (KT1) or blinded (btz1). |
delegate hash |
Current delegate (may be self when registered as delegate). |
creator hash |
Contract creator account. |
pubkey hash |
Revealed public key. |
first_in int64 |
Block height of first incoming transaction. |
first_out int64 |
Block height of first outgoing transaction. |
last_in int64 |
Block height of latest incoming transaction. |
last_out int64 |
Block height of latest outgoing transaction. |
first_seen int64 |
Block height of account creation. |
last_seen int64 |
Block height of last activity. |
delegated_since int64 delegator-only |
Block height of most recent delegation. |
delegate_since int64 baker-only |
Block height of most recent baker registration. |
delegate_until int64 baker-only |
Block height of most recent baker deactivation. |
first_in_time datetime |
Block time of first incoming transaction. |
first_out_time datetime |
Block time of first outgoing transaction. |
last_in_time datetime |
Block time of latest incoming transaction. |
last_out_time datetime |
Block time of latest outgoing transaction. |
first_seen_time datetime |
Block time of account creation. |
last_seen_time datetime |
Block time of last activity. |
delegated_since_time datetime delegator-only |
Block time of most recent delegation. |
delegate_since_time datetime baker-only |
Block time of most recent baker registration. |
delegate_until_time datetime baker-only |
Block time of most recent baker deactivation. |
total_received money |
Lifetime total tokens received in transactions. |
total_sent money |
Lifetime total tokens sent in transactions. |
total_burned money |
Lifetime total tokens burned in tz. |
total_fees_paid money |
Lifetime fees paid in tz. |
total_rewards_earned money baker-only |
Lifetime rewards earned in tz. |
total_fees_earned money baker-only |
Lifetime fees earned in tz. |
total_lost money baker-only |
Lifetime total tokens lost in tz. |
frozen_deposits money baker-only |
Currently frozen deposits |
frozen_rewards money baker-only |
Currently frozen rewards. |
frozen_fees money baker-only |
Currently frozen fees. |
unclaimed_balance money |
Currently unclaimed balance (for vesting contracts and commitments). |
spendable_balance money |
Currently spendable balance. |
total_balance money |
Currently spendable and frozen balances (except frozen rewards). |
delegated_balance money baker-only |
(delegate only) Current incoming delegations. |
staking_balance money baker-only |
(delegate only) Current delegated and own total balance. |
total_delegations int64 baker-only |
(delegate only) Lifetime count of delegations. |
active_delegations int64 baker-only |
(delegate only) Currently active and non-zero delegations. |
is_funded bool |
Flag indicating the account is funded. |
is_activated bool |
Flag indicating the account was activated from a commitment. |
is_delegated bool |
Flag indicating the account is currently delegated. |
is_revealed bool |
Flag indicating the account has a revealed public key . |
is_delegate bool |
Flag indicating the account is a registered delegate. |
is_active_delegate bool |
Flag indicating the account is a registered and active delegate. |
is_contract bool |
Flag indicating the account is a smart contract. |
blocks_baked int64 baker-only |
Lifetime total blocks baked. |
blocks_missed int64 baker-only |
Lifetime total block baking missed. |
blocks_stolen int64 baker-only |
Lifetime total block baked at priority > 0. |
blocks_endorsed int64 baker-only |
Lifetime total blocks endorsed. |
slots_endorsed int64 baker-only |
Lifetime total endorsemnt slots endorsed. |
slots_missed int64 baker-only |
Lifetime total endorsemnt slots missed. |
n_ops int64 |
Lifetime total number of operations sent and received. |
n_ops_failed int64 |
Lifetime total number of operations sent that failed. |
n_tx int64 |
Lifetime total number of transactions sent and received. |
n_delegation int64 |
Lifetime total number of delegations sent. |
n_origination int64 |
Lifetime total number of originations sent. |
n_proposal int64 baker-only |
Lifetime total number of proposals (operations) sent. |
n_ballot int64 baker-only |
Lifetime total number of ballots sent. |
token_gen_min int64 |
Minimum generation number of all tokens owned. |
token_gen_max int64 |
Maximum generation number of all tokens owned. |
grace_period int64 baker-only |
(delegate only) Current grace period before deactivation. |
rolls int64 baker-only |
(delegate only) Currently owned rolls. |
rich_rank int64 meta-arg |
Global rank on rich list by total balance. Requires meta=1 argument. |
traffic_rank int64 meta-arg |
Global rank on 1D most active accounts by transactions sent/received. Requires meta=1 argument. |
volume_rank int64 meta-arg |
Global rank on 1D most active accounts by volume sent/received. Requires meta=1 argument. |
last_bake_height int64 baker-only |
Height of most recent block baked. |
last_bake_block hash baker-only |
Hash of most recent block baked. |
last_bake_time datetime baker-only |
Timestamp of most recent block baked. |
last_endorse_height int64 baker-only |
Height of most recent block endorsed. |
last_endorse_block hash baker-only |
Hash of most recent block endorsed. |
last_endorse_time datetime baker-only |
Timestamp of most recent block endorsed. |
next_bake_height int64 baker-only |
Height of next block baking right. |
next_bake_priority int64 baker-only |
Priority of next baking right (fixed at zero currently). |
next_bake_time datetime baker-only |
Approximate time of next block baking right. |
next_endorse_height int64 baker-only |
Height of next block endorsing right. |
next_endorse_time datetime baker-only |
Approximate time of next block endorsing right. |
avg_luck_64 float baker-only |
Average luck to get random priority zero baking/endorsing rights for the past 64 cycles (182 days, 6 months). |
avg_performance_64 float baker-only |
Average performance for the past 64 cycles (182 days, 6 months). |
avg_contribution_64 float baker-only |
Average utilization of rights to bake/endorse blocks for the past 64 cycles. Since block rewards have become dynamic, a baker who fails to contribute to the consensus by utilizing 100% of their rights diminishes the income for other bakers. |
baker_version hash baker-only |
Software version run by the baker at the last seen block. This is the first 8 hex digits of the Git repository hash. |
metadata object meta-arg |
Embedded account metadata if available. Requires meta=1 argument. |
List Account Operations
GET https://api.tzstats.com/explorer/account/{hash}/operations
Lists operations sent from and to an account (defaults to all types and ascending order). This endpoint supports pagination with limit
, offset
and cursor
. Use type
to filter for a specific operation type (e.g. transaction), block
(int64|hash) to lock a call to a specific block height or hash (hash is reorg-aware and throws an error when block has become orphan). To query for updates after a certain block use the optional argument since
(int64|hash). To change the order of returned calls use the optional order
(asc|desc) parameter. Use meta
(boolean) to add optional account metadata.
List Managed and Created Contracts
GET https://api.tzstats.com/explorer/account/{hash}/contracts
Lists all contracts this account has originated. This endpoint has been renamed from ../managed
.
List Account Ballots
GET https://api.tzstats.com/explorer/account/{hash}/ballots
Lists all voting ballots the account has sent. This applies to bakers only.
Bakers
Get a list of all active bakers, their current status and affiliation metadata. Optionally filter by status and country or get a random list of suggestions for a given account. This endpoint is supposed to be a simple to use listing feature for wallets and other dapps who like to enable delegation.
Filter Options
You can filter the baker list by the following criteria
Argument | Description |
---|---|
status enum |
Filter by baker status public , private , closing , closed . |
country enum |
Filter by baker country of operation (use ISO 3166-1 Alpha-2 country codes, that’s two uppercase letters like US, DE, FR) |
suggest address |
Return a suggested list of bakers for the given address (see below) |
cursor int |
Last baker id after which to continue listing, use for paging. |
limit int |
Max number of results to return (max 100). |
offset int |
Skip first N results, use for paging instead of cursor. |
Baker Metadata
Example request.
curl "https://api.tzstats.com/explorer/bakers"
Example response.
[
{
"id": 25,
"address": "tz3RDC3Jdn4j15J7bBHZd29EUee9gVB1CxD9",
"baker_since_time": "2018-06-30T17:39:57Z",
"baker_version": "08c80261",
"total_balance": 4154340.635312,
"spendable_balance": 2278833.605283,
"frozen_deposits": 1875456,
"frozen_rewards": 56192.978868,
"frozen_fees": 51.030029,
"staking_balance": 23075358.608475,
"staking_capacity": 44295492.209474,
"active_delegations": 9,
"is_full": false,
"rolls": 2884,
"avg_luck_64": 10033,
"avg_performance_64": 9783,
"avg_contribution_64": 9866,
"metadata": {
"name": "Foundation Baker 1",
"category": "validator",
"status": "private",
"country": "CH",
"twitter": "TezosFoundation",
"logo": true,
"non_delegatable": true
}
},
// ...
]
Returns metadata about a bigmap.
HTTP Request
GET https://api.tzstats.com/explorer/bakers
HTTP Response
Field | Description |
---|---|
id int64 |
Internal account id, use for cursor-based paging. |
address hash |
Baker account address. |
baker_since_time datetime |
Time when baker registered. |
baker_version hex |
Git hash of mist recently seen baker software. |
total_balance money |
Currently spendable and frozen balances (except frozen rewards). |
spendable_balance money |
Currently spendable balance. |
frozen_deposits money |
Currently frozen deposits |
frozen_rewards money |
Currently frozen rewards. |
frozen_fees money |
Currently frozen fees. |
staking_balance money |
Current delegated and own total balance. |
staking_capacity money |
Available delegation capacity (before overdelegation). |
active_delegations int64 |
Currently active and non-zero delegations. |
is_full bool |
Flag indicating the baker cannot accept more delegations, i.e. is overdelegated. |
rolls int64 |
Number of rolls currently owned. |
avg_luck_64 float |
Average luck to get random priority zero baking/endorsing rights for the past 64 cycles (182 days, 6 months). |
avg_performance_64 float |
Average reward generation performance for the past 64 cycles (182 days, 6 months). |
avg_contribution_64 float |
Average utilization of rights to bake/endorse blocks for the past 64 cycles. |
metadata object |
Extra account metadata. |
Bigmaps
Bigmaps are key-value stores where smart contracts can store large amounts of data. Values in bigmaps are accessed by unique keys. The TzStats bigmap index supports different key encodings: a hash (script expression hash), the binary representation of a key and the native typed version of a key. For convenience, all three variants are present in responses as key_hash
, key_binary
and key
.
Types A bigmap is defined by a key_type
and a value_type
. While the key type is most often a simple type (int, string, bytes, address, etc), the value can have a complex type structure. Complex keys (using pairs) are represented as JSON primitive tree and a collapsed stringified version of such keys is returned in the optional key_pretty
field. Values are represented in unboxed (decoded) form and optionally as original Michelson primitives.
Unboxing The API supports a mix of multiple representations for keys and values. Per default only decoded keys (as hash, binary, and native) and unboxed values are returned. Unboxing uses the types and annotations defined on contract origination to decompose Michelson primitives into nested JSON objects where annotations become JSON property names. Use the optional request parameter prim
(bool) to include the native Michelson value representation (a tree of primitives).
Packed Data When keys or values are packed using the PACK
instruction, an unpacked version can be obtained when using the optional unpack
(bool) query argument. In this case two additional properties key_unpacked
and value_unpacked
are added to the result.
Metadata Each bigmap entry comes with a set of metadata that describes latest update time, block hash and height as well as the bigmap id and its owner. Bigmap ownership is 1:N, ie. a smart contract can own multiple bigmaps, but each bigmap has only one owner.
Pagination The Bigmap API support paginated queries for keys, values and updates using limit
and offset
.
Time-lock To query a bigmap at a certain point in time (ie. a specific block) use the optional query argument block
(int64|hash) to specify a height or block hash. Hash is reorg-aware, ie. in case you execute a query on a block that becomes orphaned, the API returns a 409 Conflict error. To query for updates after a certain block use the optional argument since
(int64|hash).
SECURITY WARNING
Unlike other on-chain data where values and ranges are predictable the contents of bigmaps are entirely user-controlled and unpredictable. IT MAY CONTAIN MALICIOUS DATA INTENDED TO ATTACK YOUR APPLICATIONS AND USERS! Be vigilant and sanitize all data before you process or display it.
Bigmap Metadata
Example request.
curl "https://api.tzstats.com/explorer/bigmap/1"
Example response.
{
"contract": "KT1R3uoZ6W1ZxEwzqtv75Ro7DhVY6UAcxuK2",
"bigmap_id": 1,
"n_updates": 0,
"n_keys": 0,
"alloc_height": 5938,
"alloc_block": "BLCpcCQhYrqMSgAY9vdnAXPXmswBizTJbVAj9yWSXfbUGhXzd3z",
"alloc_time": "2018-07-04T20:59:27Z",
"update_height": 5938,
"update_block": "BLCpcCQhYrqMSgAY9vdnAXPXmswBizTJbVAj9yWSXfbUGhXzd3z",
"update_time": "2018-07-04T20:59:27Z"
}
Returns metadata about a bigmap.
HTTP Request
GET https://api.tzstats.com/explorer/bigmap/{id}
HTTP Response
Field | Description |
---|---|
contract hash |
Contract that owns the bigmap. |
bigmap_id int64 |
Unique on-chain id of this bigmap. |
n_updates int64 |
Total update count. |
n_keys int64 |
Current number of keys in bigmap. |
alloc_height int64 |
Height when the bigmap was allocated. |
alloc_block hash |
Hash of the block where the bigmap was allocated. |
alloc_time datetime |
Timestamp when the bigmap was allocated. |
update_height int64 |
Last update height. |
update_block hash |
Hash of the block containing the latest update. |
update_time datetime |
Last update timestamp. |
Bigmap Type
Example request.
curl "https://api.tzstats.com/explorer/bigmap/17/type"
Example response.
{
"contract": "KT1ChNsEFxwyCbJyWGSL3KdjeXE28AY1Kaog",
"bigmap_id": 17,
"key_type": "key_hash",
"key_encoding": "bytes",
"value_type": {
"0@data@option": {
"0@bakerName": "bytes",
"1@openForDelegation": "bool",
"2@bakerOffchainRegistryUrl": "bytes",
"3@split": "nat",
"4@bakerPaysFromAccounts@list": {
"0": "address"
},
"5@minDelegation": "nat",
"6@subtractPayoutsLessThanMin": "bool",
"7@payoutDelay": "int",
"8@payoutFrequency": "nat",
"9@minPayout": "int",
"10@bakerChargesTransactionFee": "bool",
"11@paymentConfigMask": "nat",
"12@overDelegationThreshold": "nat",
"13@subtractRewardsFromUninvitedDelegation": "bool"
},
"1@reporterAccount@option": "address",
"2@last_update": "timestamp"
},
"prim": {
// ...
}
}
Returns bigmap type description in Michelson JSON format, both for keys and values. Keys are simple scalar types and values can have a simple or complex type. JSON keys for bigmap type arguments now always follow the convention <order>@<name>@<container-type>
, ie. they include an integer order number as first argument (starting at zero), followed by an optional @
symbol, an optional name extracted from type annotations and in case the type is a container like list, map or set another @
and the container type. JSON value contains a string with the michelson type name (if scalar) or a JSON object describing the nested type following the same naming conventions. Use prim
(boolean) to embed original Michelson primitives for key and value type definitions.
HTTP Request
GET https://api.tzstats.com/explorer/bigmap/{id}/type
HTTP Response
Field | Description |
---|---|
contract hash |
Contract that owns the bigmap. |
bigmap_id int64 |
Unique on-chain id of this bigmap. |
key_type object |
Michelson type for keys (i.e. any comparable Michelson type) as JSON encoded Michelson primitives. |
key_encoding enum |
Encoding used for keys (e.g. string , bytes , int ). |
value_type object |
Unboxed Michelson type for values as JSON encoded Michelson primitives. |
prim object |
Native JSON encoded Michelson primitives (optional, use prim=true to enable). |
List Bigmap Keys
Example request.
curl "https://api.tzstats.com/explorer/bigmap/12/keys"
Example response.
[[
{
"key": "0501000000044e4c4576",
"key_hash": "exprtxcQXJiJWzb5PvjHzkf2LKvnvmbvKdNDSvWzegiTMAKsvTgijL",
"key_binary": "0501000000044e4c4576",
"key_unpacked": "NLEv",
"key_pretty": "NLEv",
"meta": {
"contract": "KT1NQfJvo9v8hXmEgqos8NP7sS8V4qaEfvRF",
"bigmap_id": 12,
"time": "2019-10-25T16:37:56Z",
"height": 665512,
"block": "BKucUF1pxUv7JsrmKoLhmoXeoAzBvKUdZA7PVXEEUACyE7PR6qa",
"is_replaced": false,
"is_removed": false
},
"prim": {
"prim": "bytes"
}
},
// ...
]
Lists bigmap keys only. Supports paging with limit
and offset
and locking calls to a specific block
height (int64) or hash (hash). Use prim
(boolean) to embed original Michelson primitives and unpack
(boolean) to unpack packed keys.
HTTP Request
GET https://api.tzstats.com/explorer/bigmap/{id}/keys
HTTP Response
Field | Description |
---|---|
key polymorph |
The native representation of the key. Integers are bigints wrapped in strings, other types are rendered according to type rules, e.g. addresses, keys and signatures are base58check encoded, timestamps are ISO8601, etc. Can be used for lookup. |
key_hash hash |
The script expression hash for this key. Can be used for lookup. |
key_binary string |
Hex string containing the binary representation of the key as stored on-chain. Can be used for lookup. |
key_unpacked polymorph |
Unpacked version of the key as Michelson primitives (Pair keys only) or scalar type (all other types). Optional, enable with unpack=true . Cannot be used for lookup. |
key_pretty string |
Prettified version of complex (Pair) keys where all elements are concatenated using # . Same as key or key_unpacked otherwise. Cannot be used for lookup. |
meta object |
Metadata for the current bigmap entry. |
meta.contract hash |
Contract that owns the bigmap. |
meta.bigmap_id int64 |
Unique on-chain id of this bigmap. |
meta.time datetime |
Update timestamp for this key/value pair. |
meta.height int64 |
Update height for this key/value pair. |
meta.block hash |
Hash of the block containing the latest update. |
meta.is_replaced bool |
Flag indicating if a future update has overwritten the current value. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
meta.is_removed bool |
Flag indicating if a future remove action has deleted the current key. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
prim object |
Native JSON encoded Michelson primitives (optional, use prim=true to enable). |
List Bigmap Keys and Values
Example request.
curl "https://api.tzstats.com/explorer/bigmap/382/values"
Example response.
[
{
"key": "0501000000044e4c4576",
"key_hash": "exprtxcQXJiJWzb5PvjHzkf2LKvnvmbvKdNDSvWzegiTMAKsvTgijL",
"key_binary": "0501000000044e4c4576",
"key_unpacked": "NLEv",
"key_pretty": "NLEv",
"value": {
"0@bytes": "050000"
},
"value_unpacked": "0",
"meta": {
"contract": "KT1NQfJvo9v8hXmEgqos8NP7sS8V4qaEfvRF",
"bigmap_id": 12,
"time": "2019-10-25T16:37:56Z",
"height": 665512,
"block": "BKucUF1pxUv7JsrmKoLhmoXeoAzBvKUdZA7PVXEEUACyE7PR6qa",
"is_replaced": false,
"is_removed": false
},
"prim": {
"key": {
"bytes": "0501000000044e4c4576"
},
"value": {
"bytes": "050000"
}
}
},
// ...
]
Lists key/value pairs contained in bigmap. This endpoint supports paging with limit
and offset
and also allows locking paginated calls to a specific block
height (int64) or hash (hash). Use prim
(boolean) to embed original Michelson primitives and unpack
(boolean) to unpack packed keys and values.
HTTP Request
GET https://api.tzstats.com/explorer/bigmap/{id}/values
Lists all values contained in the bigmap at present time, ie. at blockchain head. Can return bigmap contents at a specific block in the past using the optional parameter block
height (int64) or hash (hash).
GET https://api.tzstats.com/explorer/bigmap/{id}/{key}
Returns a single bigmap value stored at key
. Key can be a key hash (script expr hash), the native key representation (i.e. an address or integer) or the encoded binary version of the key. Use the optional block
height (int64) or hash (hash) parameter to lookup the key’s value at a specific block in the past.
HTTP Response
Field | Description |
---|---|
key polymorph |
The native representation of the key. Integers are bigints wrapped in strings, other types are rendered according to type rules, e.g. addresses, keys and signatures are base58check encoded, timestamps are ISO8601, etc). |
key_hash hash |
The script expression hash for this key. |
key_binary string |
Hex string containing the binary representation of the key as stored on-chain. |
key_unpacked polymorph |
Unpacked version of the key as Michelson primitives (Pair keys only) or scalar type (all other types). Optional, enable with unpack=true . |
key_pretty string |
Prettified version of complex (Pair) keys where all elements are concatenated using # . Same as key or key_unpacked otherwise. |
value object |
Unboxed version of the bigmap value, either a simple value or complex nested structure using scalar types, lists, sets, maps, and bigmaps. |
value_unpacked object |
An unpacked version of any packed binary data contained in the value. This can be a scalar type or a Michelson primitive tree if the type is complex such as lambda, pair, etc. |
meta object |
Metadata for the current bigmap entry. |
meta.contract hash |
Contract that owns the bigmap. |
meta.bigmap_id int64 |
Unique on-chain id of this bigmap. |
meta.time datetime |
Update timestamp for this key/value pair. |
meta.height int64 |
Update height for this key/value pair. |
meta.block hash |
Hash of the block containing the latest update. |
meta.is_replaced bool |
Flag indicating if a future update has overwritten the current value. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
meta.is_removed bool |
Flag indicating if a future remove action has deleted the current key. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
prim object |
Native Michelson JSON encoded value as prim tree. Optional, use prim to enable. |
List Bigmap Updates
Example request.
curl "https://api.tzstats.com/explorer/bigmap/382/updates"
Example response.
[
{
"key": "0501000000044e4c4576",
"key_hash": "exprtxcQXJiJWzb5PvjHzkf2LKvnvmbvKdNDSvWzegiTMAKsvTgijL",
"key_binary": "0501000000044e4c4576",
"key_unpacked": "NLEv",
"key_pretty": "NLEv",
"value": "050000",
"value_unpacked": "0",
"meta": {
"contract": "KT1NQfJvo9v8hXmEgqos8NP7sS8V4qaEfvRF",
"bigmap_id": 12,
"time": "2019-10-25T16:37:56Z",
"height": 665512,
"block": "BKucUF1pxUv7JsrmKoLhmoXeoAzBvKUdZA7PVXEEUACyE7PR6qa",
"is_replaced": false,
"is_removed": false
},
"action": "update",
"prim": {
"key": {
"bytes": "0501000000044e4c4576"
},
"value": {
"bytes": "050000"
}
}
},
]
List historic updates to a bigmap in chronological order, including keys that have been deleted. Returns an array of objects. This endpoint supports paging with limit
and offset
. Use the optional since
(int64|hash) parameter to return updates newer or equal to a specific block. Use prim
(boolean) to embed original Michelson primitives and unpack
(boolean) to unpack packed keys and values.
HTTP Request
GET https://api.tzstats.com/explorer/bigmap/{id}/updates
Lists all updates across the entire bigmap.
GET https://api.tzstats.com/explorer/bigmap/{id}/{key}/updates
Lists updates for a specific key. Key can be a key hash (script expr hash), the native key representation (i.e. an address or integer) or the encoded binary version.
HTTP Response
Contains the same fields as the values endpoint above with one addition:
Field | Description |
---|---|
action enum |
Update kind, one of alloc , update , remove , copy . |
Blocks
Example request.
curl "https://api.tzstats.com/explorer/block/1342853?meta=1&rights=1"
Example response.
{
"hash": "BLhRjTFhk37a8vgE2M5DU2cCbtV3qJHaBBPvTboHfyLYV74hM99",
"predecessor": "BKjZfegUTsCD3eURHPur6L6zRmS6c6D9cdwLKoFDU9DcmJmWnaY",
"successor": "BMKvd7HhwnhCTSWGG2YkDrsWSugcZefo1V5i9gZ2Khz87S3e98k",
"baker": "tz1bTpviNnyx2PXsNmGpCQTMQsGoYordkUoA",
"height": 1342853,
"cycle": 327,
"is_cycle_snapshot": false,
"time": "2021-02-13T10:16:55Z",
"solvetime": 60,
"version": 7,
"validation_pass": 4,
"fitness": 687493,
"priority": 0,
"nonce": "6102c808a62a0100",
"voting_period_kind": "promotion_vote",
"endorsed_slots": 4294959103,
"n_endorsed_slots": 31,
"n_ops": 28,
"n_ops_failed": 0,
"n_ops_contract": 1,
"n_tx": 7,
"n_activation": 0,
"n_seed_nonce_revelations": 0,
"n_double_baking_evidences": 0,
"n_double_endorsement_evidences": 0,
"n_endorsement": 19,
"n_delegation": 1,
"n_reveal": 1,
"n_origination": 0,
"n_proposal": 0,
"n_ballot": 0,
"volume": 98233.072783,
"fee": 0.019784,
"reward": 38.75,
"deposit": 512,
"unfrozen_fees": 0,
"unfrozen_rewards": 0,
"unfrozen_deposits": 0,
"activated_supply": 0,
"burned_supply": 0.19275,
"n_accounts": 31,
"n_new_accounts": 1,
"n_new_implicit": 1,
"n_new_managed": 0,
"n_new_contracts": 0,
"n_cleared_accounts": 0,
"n_funded_accounts": 3,
"gas_limit": 113904,
"gas_used": 15466,
"gas_price": 1.27919,
"storage_size": 621,
"days_destroyed": 812.427699,
"pct_account_reuse": 96.7741935483871,
"n_ops_implicit": 1,
"metadata": {
"tz1KfEsrtDaA1sX7vdM4qmEPWuSytuqCDp5j": {
"name": "XTZ Master",
"category": "validator",
"status": "public",
"country": "AU",
"twitter": "Xtzmastercom",
"logo": true,
"fee": 0.08,
"payout_delay": true
},
// ...
},
"rights": [
{
"type": "baking",
"priority": 0,
"account": "tz1bTpviNnyx2PXsNmGpCQTMQsGoYordkUoA",
"is_used": true
},
{
"type": "endorsing",
"slot": 0,
"account": "tz2FCNBrERXtaTtNX6iimR1UJ5JSDxvdHM93",
"is_used": true
},
// ...
]
}
Fetches information about the specified block. Takes either a block hash
, a block height
or the string head
as argument. Use meta
(boolean) to embed optional account metadata and rights
to embed rights information.
HTTP Request
GET https://api.tzstats.com/explorer/block/{hash,height,head}
HTTP Response
Field | Description |
---|---|
hash hash |
Block hash. |
predecessor hash |
Parent block on canonical chain or orphan side-chain. |
successor hash |
Child block on canonical chain or orphan side-chain. |
baker hash |
Baker address. |
height int64 |
Block height (a.k.a level). |
cycle int64 |
Cycle |
is_cycle_snapshot bool |
True if this block has been selected as snapshot. |
time datetime |
Block creation time. |
solvetime duration |
Time since last block in seconds. |
version int64 |
Protocol version. |
validation_pass int64 |
Block validation pass. |
fitness int64 |
Block fitness used to determine longest chain. |
priority int64 |
Baking priority. |
nonce uint64 |
Block nonce |
voting_period_kind enum |
Current voting period proposal , testing_vote , testing , promotion_vote . |
endorsed_slots uint64 |
32bit big-endian bitmask indicating which slots have been endorsed. (Note this field will be set from endorsements published in the subsequent block.) |
n_endorsed_slots int64 |
Count of endorsed slots. (Note this field will be set from endorsements published in the subsequent block.) |
n_ops int64 |
Count of operations contained in this block. |
n_ops_failed int64 |
Count of failed operations. |
n_ops_contract int64 |
Count of smart contract operations (transactions sent to contracts and internal operations sent by contracts). |
n_ops_implicit int64 |
Count of implicit events, ie. operations and state changes that don’t have an operation hash such as bake , unfreeze , seed_slash , airdrop and invoice . |
n_tx int64 |
Count of transaction operations. |
n_activation int64 |
Count of activate_account operations. |
n_seed_nonce_revelation int64 |
Count of seed_nonce_revelation operations. |
n_double_baking_evidence int64 |
Count of double_baking_evidence operations. |
n_double_endorsement_evidence int64 |
Count of double_endorsement_evidence operations. |
n_endorsement int64 |
Count of endorsement operations. |
n_delegation int64 |
Count of delegation operations. |
n_reveal int64 |
Count of reveal operations. |
n_origination int64 |
Count of origination operations. |
n_proposal int64 |
Count of proposals operations. |
n_ballot int64 |
Count of ballot operations. |
volume money |
Total amount of tokens moved between accounts. |
fee money |
Total fee paid (and frozen) by all operations. |
reward money |
Reward earned (and frozen) by the block baker. |
deposit money |
Deposit frozen by the block baker. |
unfrozen_fees money |
Total unfrozen fees (at end of a cycle). |
unfrozen_rewards money |
Total unfrozen rewards (at end of a cycle). |
unfrozen_deposits money |
Total unfrozen deposits (at end of a cycle). |
activated_supply money |
Total amount of commitments activated in tz. |
burned_supply money |
Total amount of tokens burned by operations in tz. |
n_accounts int64 |
Count of accounts seen in this block (i.e. this includes all operation senders, receivers, delegates and the block’s baker). |
n_new_accounts int64 |
Count of new accounts created regardless of type. |
n_new_implicit int64 |
Count of created implicit accounts (tz1/2/3). |
n_new_managed int64 |
Count of created managed accounts (KT1 without code or manager.tz script). |
n_new_contracts int64 |
Count of created smart contracts (KT1 with code). |
n_cleared_accounts int64 |
Count of accounts that were emptied (final balance = 0). |
n_funded_accounts int64 |
Count of accounts that were funded by operations (this includes all new accounts plus previously cleared accounts that were funded again). |
gas_limit int64 |
Total gas limit defined by operations. |
gas_used int64 |
Total gas consumed by operations. |
gas_price float |
Average price of one gas unit in mutez. |
storage_size int64 |
Total sum of new storage allocated by operations. |
days_destroyed float |
Token days destroyed (tokens transferred * token idle time ). |
pct_account_reuse float |
Portion of seen accounts that existed before. |
metadata object |
Optional account metadata for baker and endorsers, missing when no metadata is available. Endorser metadata is only embedded when rights arg is also set. |
rights array |
List of endorsing (all slots) and baking rights (all priorities up to block priority) including owner and status. |
List Block Operations
Example request to list block operations.
curl "https://api.tzstats.com/explorer/block/head/operations?meta=1"
Example response.
[
{
"row_id": 41092042,
"hash": "",
"type": "bake",
"block": "BMbQcVE5Yf7MnzGwHqFWHxwGgL4o6dBK1NywSSWVDYDFHZJijHE",
"time": "2021-02-13T10:23:55Z",
"height": 1342860,
"cycle": 327,
"counter": 0,
"op_n": 0,
"op_l": -1,
"op_p": 0,
"op_c": 0,
"op_i": 0,
"status": "applied",
"is_success": true,
"is_contract": false,
"gas_limit": 0,
"gas_used": 0,
"gas_price": 0,
"storage_limit": 0,
"storage_size": 0,
"storage_paid": 0,
"volume": 0,
"fee": 0.001411,
"reward": 40,
"deposit": 512,
"burned": 0,
"is_internal": false,
"has_data": false,
"days_destroyed": 0,
"sender": "tz1cYufsxHXJcvANhvS55h3aY32a9BAFB494",
"receiver": "tz1cYufsxHXJcvANhvS55h3aY32a9BAFB494",
"branch_height": 0,
"branch_depth": 0,
"branch": "",
"is_implicit": true,
"entrypoint_id": 0,
"is_orphan": false,
"is_batch": false,
"is_sapling": false,
"metadata": {
"tz1cYufsxHXJcvANhvS55h3aY32a9BAFB494": {
"name": "Bakery IL",
"category": "validator",
"status": "public",
"country": "IL",
"city": "TLV",
"twitter": "bakery_il",
"logo": true,
"fee": 0.05,
"payout_delay": true
}
}
},
{
"row_id": 41092043,
"hash": "oot3dWrNZ575XFcnE3bEUutpTvgdpZKD8B4mi9R8bpueFoAS7Z2",
"type": "endorsement",
"block": "BMbQcVE5Yf7MnzGwHqFWHxwGgL4o6dBK1NywSSWVDYDFHZJijHE",
"time": "2021-02-13T10:23:55Z",
"height": 1342860,
"cycle": 327,
"counter": 0,
"op_n": 1,
"op_l": 0,
"op_p": 0,
"op_c": 0,
"op_i": 0,
"status": "applied",
"is_success": true,
"is_contract": false,
"gas_limit": 0,
"gas_used": 0,
"gas_price": 0,
"storage_limit": 0,
"storage_size": 0,
"storage_paid": 0,
"volume": 0,
"fee": 0,
"reward": 1.25,
"deposit": 64,
"burned": 0,
"is_internal": false,
"has_data": true,
"days_destroyed": 0,
"data": "8192",
"sender": "tz1LBEKXaxQbd5Gtzbc1ATCwc3pppu81aWGc",
"branch_height": 1342859,
"branch_depth": 1,
"branch": "BKsbXn1onZrqqeonG8PLaFVeuqjw2k3evdVjx5XtP8ippw3Hmyo",
"is_implicit": false,
"entrypoint_id": 0,
"is_orphan": false,
"is_batch": false,
"is_sapling": false,
"metadata": {
"tz1LBEKXaxQbd5Gtzbc1ATCwc3pppu81aWGc": {
"name": "Tez-Baking",
"category": "validator",
"status": "public",
"country": "SE",
"city": "ARN",
"twitter": "TezBakingCom",
"logo": true,
"fee": 0.15,
"payout_delay": true
}
}
},
// ...
]
}
Returns a list of operations in the corresponding block. Use limit
, offset
and/or cursor
(all integers) to page through operation lists. Operations are sorted by row_id in ascending order. Cursor is the last row_id in sort order you have seen. Use order
to switch between asc
or desc
order. Allows filtering operations by type
using query filters. Use meta
(boolean) to embed optional account metadata for all related accounts like senders, receivers, delegates.
The result contains information about all events that happen on-chain. Some of these events are signed operations with a proper operation hash, others are implicit events that have no corresponding representation, but are still required to correctly reconcile account balances and on-chain state/relationships. Important examples for implicit events are bake
and unfreeze
which change balances of bakers on their sub-accounts.
HTTP Request
List Block Operations
GET https://api.tzstats.com/explorer/block/{hash,height,head}/operations
Blockchain Config
Example request.
curl "https://api.tzstats.com/explorer/config/head"
Example response.
{
"name": "Tezos",
"network": "Mainnet",
"symbol": "XTZ",
"chain_id": "NetXdQprcVkpaWU",
"deployment": 7,
"version": 7,
"protocol": "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
"start_height": 1212417,
"end_height": -1,
"no_reward_cycles": 0,
"security_deposit_ramp_up_cycles": 0,
"decimals": 6,
"units": 1000000,
"block_reward": 40,
"block_security_deposit": 512,
"blocks_per_commitment": 32,
"blocks_per_cycle": 4096,
"blocks_per_roll_snapshot": 256,
"blocks_per_voting_period": 32768,
"cost_per_byte": 250,
"endorsement_reward": 1.25,
"endorsement_security_deposit": 64,
"endorsers_per_block": 32,
"hard_gas_limit_per_block": 10400000,
"hard_gas_limit_per_operation": 1040000,
"hard_storage_limit_per_operation": 60000,
"max_operation_data_length": 16384,
"max_proposals_per_delegate": 20,
"max_revelations_per_block": 0,
"michelson_maximum_type_size": 1000,
"nonce_length": 32,
"origination_burn": 0,
"origination_size": 257,
"preserved_cycles": 5,
"proof_of_work_nonce_size": 8,
"proof_of_work_threshold": 70368744177663,
"seed_nonce_revelation_tip": 0.125,
"time_between_blocks": [
60,
40
],
"tokens_per_roll": 8000,
"test_chain_duration": 1966080,
"min_proposal_quorum": 500,
"quorum_min": 2000,
"quorum_max": 7000,
"block_rewards_v6": [
1.25,
0.1875
],
"endorsement_rewards_v6": [
1.25,
0.833333
],
"max_anon_ops_per_block": 132,
"num_voting_periods": 4
}
Fetches blockchain configuration parameters. This endpoint accepts head
and a block height
as path parameters, so you can access configurations of past protocols as well.
HTTP Request
GET https://api.tzstats.com/explorer/config/head
HTTP Response
The response contains most of the configuration fields of a regular Tezos blockchain node, enriched with some additional contextual data.
Field | Description |
---|---|
name string |
Blockchain name (Tezos ). |
symbol string |
Ticker symbol (XTZ ). |
network string |
Network name (e.g. Mainnet , Zeronet , Babylonnet , Labnet , Sandbox ). |
chain_id hash |
Chain hash. |
version int64 |
Protocol version number. |
deployment int64 |
Number of deployed protocols on this network. |
protocol hash |
Protool hash. |
start_height int64 |
Activation height of the protocol. |
end_height int64 |
Deactivation height of the protocol (0 if undefined). |
no_reward_cycles int64 |
Number of initial cycles that pay no block rewards. |
security_deposit_ramp_up_cycles int64 |
Number of initial cycles before full deposits are required. |
decimals int64 |
Decimal points of one coin unit. |
units int64 |
Number of atomic units in one coin (i.e. mutez). |
block_reward money |
Block baking reward in tz. |
block_security_deposit money |
Baker security deposit in tz. |
blocks_per_commitment int64 |
Number of blocks between seed nonce commitments. |
blocks_per_cycle int64 |
Number of blocks per consensus cycle. |
blocks_per_roll_snapshot int64 |
Number of blocks between roll snapshots. |
blocks_per_voting_period int64 |
Number of blocks per voting period. |
cost_per_byte int64 |
Gas costs per data byte. |
endorsement_reward money |
Block endorsing reward per slot in tz. |
endorsement_security_deposit money |
Endorser security deposit per slot in tz. |
endorsers_per_block int64 |
Max number of endorsing slots. |
hard_gas_limit_per_block int64 |
Max gas limit per block. |
hard_gas_limit_per_operation int64 |
Max gas limit per single operation. |
hard_storage_limit_per_operation int64 |
Max gas limit for storage spent be an operation. |
max_operation_data_length int64 |
Max data bytes per operation. |
max_proposals_per_delegate int64 |
Max proposals per single delegate and proposals operation. |
max_revelations_per_block int64 |
Maximum number of seed nonce revelation operations per block. |
michelson_maximum_type_size int64 |
Maximum type size michelson type definition. |
nonce_length int64 |
Nonce length |
origination_burn money |
Amount of Tezos burned per origination. |
origination_size int64 |
Origination storage requirement in bytes. |
preserved_cycles int64 |
Number of cycles for freezing security deposits and rewards. |
proof_of_work_nonce_size int64 |
Nonce size for P2P messages. |
proof_of_work_threshold int64 |
Threshold for message nonce complexity. |
seed_nonce_revelation_tip money |
Rewards for publishing a seed nonce. |
time_between_blocks array[int64] |
Target time between blocks in seconds. |
tokens_per_roll int64 |
Amount of Tezos per roll. |
test_chain_duration int64 |
Test chain lifetime in seconds. |
min_proposal_quorum int64 |
(Babylon, v005) Minimum quorum to accept proposals in centile (i.e. 5% = 500). |
quorum_min int64 |
(Babylon, v005) Minimum threshold for voting period quorum in centile. |
quorum_max int64 |
(Babylon, v005) Maximum threshold for voting period quorum in centile. |
block_reward_v6 [2]money |
(Carthage, v006) Block reward per included endorsement for prio 0 blocks [0] or >prio 0 blocks [1]. |
endorsement_reward_v6 [2]money |
(Carthage, v006) Reward per endorsement for a prio 0 block [0] or >prio 0 block [1]. |
max_anon_ops_per_block int64 |
(Delphi, v007) Max number of anonymous ops like seed nonces. |
num_voting_periods int64 |
(Edo, v008) Number of voting epochs, Edo introduced a 5th adoption period. |
Blockchain Tip
Example request.
curl "https://api.tzstats.com/explorer/tip"
Example response.
{
"name": "Tezos",
"network": "Mainnet",
"symbol": "XTZ",
"chain_id": "NetXdQprcVkpaWU",
"genesis_time": "2018-06-30T16:07:32Z",
"block_hash": "BLWxEruWC23hx6EvBFxr8SYCE36H2Xq3hFA3kDFEhSjBhQx7QRj",
"timestamp": "2021-02-13T10:27:55Z",
"height": 1342864,
"cycle": 327,
"total_accounts": 1101579,
"funded_accounts": 999143,
"total_ops": 39596837,
"delegators": 93314,
"delegates": 426,
"rolls": 84949,
"roll_owners": 404,
"new_accounts_30d": 103666,
"cleared_accounts_30d": 15709,
"funded_accounts_30d": 112848,
"inflation_1y": 40335052.002298,
"inflation_rate_1y": 4.884188578147172,
"health": 98,
"deployments": [
{
"protocol": "PrihK96nBAFSxVL1GLJTVhu9YnzkMFiBeuJRPA8NwuZVZCE1L6i",
"version": -1,
"deployment": -1,
"start_height": 0,
"end_height": 0
},
{
"protocol": "Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",
"version": 0,
"deployment": 0,
"start_height": 1,
"end_height": 1
},
{
"protocol": "PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",
"version": 1,
"deployment": 1,
"start_height": 2,
"end_height": 28082
},
{
"protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
"version": 2,
"deployment": 2,
"start_height": 28083,
"end_height": 204761
},
{
"protocol": "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
"version": 3,
"deployment": 3,
"start_height": 204762,
"end_height": 458752
},
{
"protocol": "Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",
"version": 4,
"deployment": 4,
"start_height": 458753,
"end_height": 655360
},
{
"protocol": "PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",
"version": 5,
"deployment": 5,
"start_height": 655361,
"end_height": 851968
},
{
"protocol": "PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",
"version": 6,
"deployment": 6,
"start_height": 851969,
"end_height": 1212416
},
{
"protocol": "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",
"version": 7,
"deployment": 7,
"start_height": 1212417,
"end_height": -1
}
],
"supply": {
"row_id": 1342865,
"height": 1342864,
"cycle": 327,
"time": "2021-02-13T10:27:55Z",
"total": 866164181.179763,
"activated": 576359477.929109,
"unclaimed": 35095400.481071,
"vested": 46582751.428168,
"unvested": 106280968.174352,
"circulating": 759883213.005411,
"delegated": 533114195.249729,
"staking": 684588680.629035,
"shielded": 0,
"active_delegated": 530853021.716629,
"active_staking": 680814744.486729,
"inactive_delegated": 2261173.5331,
"inactive_staking": 3773936.142306,
"minted": 102201165.989543,
"minted_baking": 32078464.975639,
"minted_endorsing": 70116902.006583,
"minted_seeding": 5199,
"minted_airdrop": 600.007321,
"burned": 355582.82248,
"burned_double_baking": 132029.815883,
"burned_double_endorse": 31838.219485,
"burned_origination": 9211.19225,
"burned_implicit": 177021.9575,
"burned_seed_miss": 5481.637362,
"frozen": 61860304.599122,
"frozen_deposits": 60057024,
"frozen_rewards": 1801805.068634,
"frozen_fees": 1475.530488
},
"status": {
"mode": "sync",
"status": "synced",
"blocks": 1342864,
"indexed": 1342864,
"progress": 1
}
}
Returns info about the most recent block, indexer status, protocol deployments and supply statistics.
HTTP Request
GET https://api.tzstats.com/explorer/tip
HTTP Response
Field | Description |
---|---|
name string |
Blockchain name (Tezos ). |
symbol string |
Ticker symbol (XTZ ). |
network string |
Network name (e.g. Mainnet , Zeronet , Babylonnet , Carthagenet , Sandbox ). |
chain_id hash |
Chain hash. |
genesis_time datetime |
Genesis block timestamp. |
block_hash hash |
Current block hash. |
timestamp datetime |
Current block timestamp. |
height int64 |
Current block height (level). |
cycle int64 |
Current cycle. |
total_accounts int64 |
Total number of on-chain accounts in existence. |
funded_accounts int64 |
Total number on funded (non-zero) accounts. |
total_ops int64 |
Total number of on-chain operations. |
delegators int64 |
Current number of delegators (updated each block). |
delegates int64 |
Current number of active delegates (updated each block). |
rolls int64 |
Current number of network-wide rolls (updated each block). |
roll_owners int64 |
Current number of network-wide roll owners (updated each block). |
new_accounts_30d int64 |
Accounts created during the past 30 days. |
cleared_accounts_30d int64 |
Accounts emptied during the past 30 days. |
funded_accounts_30d int64 |
Accounts (re)funded (new and previously empty) during the past 30 days. |
inflation_1y money |
Absolute inflation in tz. |
inflation_rate_1y float |
Relative annualized inflation in percent. |
health int64 |
Blockchain and consensus health indicator with range [0..100] based on recent 128 blocks (priority, endorsements, reorgs). |
supply object |
Coin supply statistics at current block height. |
status object |
Indexer status, embedded for efficiency. |
deployments object |
Protocol deployment information such as protocol hash, protocol version id, deployment order, start and end blocks. The most recent protocol deployment has -1 as end height. |
Contracts
Example request.
curl "https://api.tzstats.com/explorer/contract/KT1Puc9St8wdNoGtLiD2WXaHbWU7styaxYhD"
Example response.
{
"address": "KT1Puc9St8wdNoGtLiD2WXaHbWU7styaxYhD",
"creator": "tz1P7A3YFgeSsGgopKN9vUU86W3psgTMdtcJ",
"delegate": "tz1WCd2jm4uSt4vntk4vSuUWoZQGhLcDuR9q",
"storage_size": 34600,
"storage_paid": 34608,
"first_seen": 1149672,
"last_seen": 1342865,
"first_seen_time": "2020-09-29T16:18:45Z",
"last_seen_time": "2021-02-13T10:28:55Z",
"n_ops": 13765,
"n_ops_failed": 158,
"bigmaps": {
"accounts": 124
},
"iface_hash": "cf9361e1",
"code_hash": "666dcc01",
"call_stats": {
"addLiquidity": 608,
"approve": 0,
"default": 0,
"removeLiquidity": 230,
"setBaker": 0,
"setManager": 0,
"tokenToToken": 16,
"tokenToXtz": 2421,
"updateTokenPool": 0,
"updateTokenPoolInternal": 0,
"xtzToToken": 2195
},
"features": [
"set_delegate",
"transfer_tokens"
],
"interfaces": [
"DEXTER"
]
}
Returns metadata about a smart contract. For more details call the explorer account endpoint using the contract’s KT1 address. Separate calls support querying contract code, storage type and entrypoint specifications, storage contents and calls.
SECURITY WARNING
Unlike other on-chain data where values and ranges are predictable the contents of call parameters, storage keys/values and code/type annotations is entirely user-controlled and unpredictable. IT MAY CONTAIN MALICIOUS DATA INTENDED TO ATTACK YOUR APPLICATIONS AND USERS! Be vigilant and sanitize all data before you process or display it.
HTTP Request
GET https://api.tzstats.com/explorer/contract/{hash}
HTTP Response
Field | Description |
---|---|
address hash |
Contract address. |
creator hash |
Creator account (called manager before Babylon. |
delegate hash |
Delegate (may be empty). |
storage_size int64 |
Storage size allocated in bytes. |
storage_paid int64 |
Storage bytes paid for in bytes. |
first_seen int64 |
Block height of account creation. |
last_seen int64 |
Block height of last activity. |
delegated_since int64 |
Block height of most recent delegation. |
first_seen_time datetime |
Block time of account creation. |
last_seen_time datetime |
Block time of last activity. |
n_ops int64 |
Lifetime total number of operations sent and received. |
n_ops_failed int64 |
Lifetime total number of operations sent that failed. |
bigmaps object |
Named bigmaps owned by this contract, map between annotation used in storage spec and bigmap id. |
iface_hash bytes |
Short hash to uniquely identify the contract interface, first 4 bytes of the SHA256 hash over binary encoded Michelson script parameters. |
code_hash bytes |
Short hash to uniquely identify the contract code, first 4 bytes of the SHA256 hash over binary encoded Michelson script code. |
call_stats object |
Per-entrypoint call statistics, as named key/value pairs. |
features array |
Michelson features used by this contract. Any of account_factory , contract_factory , set_delegate , lambda , transfer_tokens , chain_id , ticket , sapling . |
interfaces array |
Standard interfaces implemented by this contract. Any of MANAGER , SET_DELEGATE , TZIP-005 , TZIP-007 , TZIP-012 , DEXTER , WXTZ_VAULT , KOLIBRI_VAULT (list will be extended). |
Related HTTP Requests
Get Contract Script
GET https://api.tzstats.com/explorer/contract/{hash}/script
Returns the native Michelson JSON encoding of the deployed smart contract code as well as type specifications for call parameters, storage and bigmaps. Also contains decoded entrypoints and unboxed storage type.
JSON keys for entrypoint arguments always follow the convention <order>@<name>
, ie. they include an integer order number as first argument, followed by an optional @
symbol and an optional argument name extracted from type annotations.
Unboxed Contract Script
Example script.
// ...
{
"script": {
"code": [
//...
],
"storage": {
// ...
},
},
"storage_type": {
"0@big_map": {
"0": "bytes",
"1": "bytes"
},
"1": "address",
"2": "nat"
},
"entrypoints": {
"__entry_00__": {
"id": 0,
"branch": "LLR",
"type": {
"0": "string",
"1": "bytes"
},
"prim": {
// ...
}
},
//...
}
},
// ...
Field | Description |
---|---|
script object |
Native Michelson primitives from contract origination containing code with sub-primitives for parameter/entrypoint spec, storage spec and code as well as the initial storage content (hidden by default, enable with prim=true ). |
storage_type object |
Unboxed storage spec using order and nesting defined in script. Uses type annotations for JSON property keys if available and a position number otherwise. Complex types like maps, lists, sets, lambda use keys of form {number}@{type} . |
entrypoint object |
List of named entrypoints using names from constructor/type annotations if present or __entry_{number}__ otherwise. |
entrypoint.$.id int64 |
Position of the entrypoint in the Michelson parameter tree. |
entrypoint.$.branch string |
Path of left (L) or right (R) branches to reach the entrypoint’s code in the Michelson code tree. |
entrypoint.$.type polymorph |
List of unboxed scalar or complex types expected as function call parameters for this entrypoint. |
entrypoint.$.prim object |
Native Michelson primitives defining the parameter types for this entrypoint (hidden by default, enable with prim=true ). |
Get Contract Storage
GET https://api.tzstats.com/explorer/contract/{hash}/storage
Returns the most recent content of the contract’s storage or, when using the optional block
(int64|hash) argument, a prior state at the specified block. Use the optional prim
(boolean) argument to embed Michelson JSON primitives.
Unboxed Contract Storage
Example storage update.
{
"meta": {
"contract": "KT1NQfJvo9v8hXmEgqos8NP7sS8V4qaEfvRF",
"time": "2019-10-25T16:41:56Z",
"height": 665516,
"block": "BLrmdRNxyY5me3UCUhf4bdbys6RbwGuNJj9jkZG6587tZVdroJi"
},
"value": {
"0@big_map": "12",
"1@lambda": [
// ...
],
"2@address": "tz1TUQZtFFZ4Eh7TsYzrL7qFVvabTM63qAqY",
"3@nat": "1",
"4@bool": false
}
}
Field | Description |
---|---|
meta object |
Metadata for the current bigmap entry. |
meta.contract hash |
Contract that owns the bigmap. |
meta.time datetime |
Update timestamp for this key/value pair. |
meta.height int64 |
Update height for this key/value pair. |
meta.block hash |
Hash of the block containing the latest update. |
value object |
Unboxed contract storage using keys derived from type annotations or of form number@type and unboxed JSON representations for content. |
prim object |
Native JSON encoded Michelson primitives of storaged values (hidden by default, enable with prim=true ). |
List Contract Calls
GET https://api.tzstats.com/explorer/contract/{hash}/calls
Returns calls (transactions) sent to the contract with embedded parameters, storage and bigmap updates. Use the optional prim
(boolean) argument to embed Michelson primitive trees in addition to unboxed call data. To query calls until a specific block use the optional query argument block
(int64|hash). Hash is reorg-aware, ie. in case you execute a query on a block that becomes orphaned, the API returns a 409 Conflict error. To query for updates after a certain block use the optional argument since
(int64|hash). To change the order of returned calls use the optional order
(asc|desc) parameter (defaults to ascending). Use the optional entrypoint
(int64|string) argument to filter calls by entrypoint. This argument takes either an id value (eg. 7), a name (eg. “mint”) or the branch (eg. “RRR”). Use meta
(boolean) to add account metadata.
Unboxed Call Parameters
Example call parameters.
// ...
"parameters": {
"entrypoint": "default",
"branch": "RRR",
"call": "mint",
"id": 7,
"value": {
//...
},
"prim": {
// ...
},
},
// ...
Call parameters are part of the call (operation) structure and contain the following properties:
Field | Description |
---|---|
entrypoint string |
Named entrypoint into the smart contract, e.g. ‘default’ or ‘entry_00. |
branch string |
Path of left (L) or right (R) branches to reach the entrypoint’s code in the Michelson code tree. |
call string |
Name of the actaully called entrypoint. This is useful if parameters contain a call to default or root entrypoints and specify the real entrypoint by branching only. |
id int64 |
Position of the entrypoint in the Michelson parameter tree. |
value object |
Call parameters in order of type definition. |
prim object |
Michelson JSON encoded representation of call parameters (hidden by default, enable with prim=true ). |
Unboxed BigMap Updates
Example storage update.
// ...
"big_map_diff": [{
"action": "update",
"key": "0501000000044e4c4576",
"key_hash": "exprtxcQXJiJWzb5PvjHzkf2LKvnvmbvKdNDSvWzegiTMAKsvTgijL",
"key_binary": "0501000000044e4c4576",
"key_unpacked": "NLEv",
"key_pretty": "NLEv",
"value": {
"0@bytes": "050000"
},
"value_unpacked": "0",
"meta": {
"contract": "KT1NQfJvo9v8hXmEgqos8NP7sS8V4qaEfvRF",
"bigmap_id": 12,
"time": "2019-10-25T16:37:56Z",
"height": 665512,
"block": "BKucUF1pxUv7JsrmKoLhmoXeoAzBvKUdZA7PVXEEUACyE7PR6qa",
"is_replaced": false,
"is_removed": false
},
"prim": {
"key": {
"bytes": "0501000000044e4c4576"
},
"value": {
"bytes": "050000"
}
}
}]
// ...
Field | Description |
---|---|
action enum |
Update kind, one of alloc , update , remove , copy . |
key polymorph |
The native representation of the key. Integers are bigints wrapped in strings, other types are rendered according to type rules, e.g. addresses, keys and signatures are base58check encoded, timestamps are ISO8601, etc). Only present on update and remove . |
key_hash hash |
The script expression hash for this key. Only present on update and remove . |
key_binary string |
Hex string containing the binary representation of the key as stored on-chain. Only present on update and remove . |
key_unpacked polymorph |
Unpacked version of the key as Michelson primitives (Pair keys only) or scalar type (all other types). Optional, enable with unpack=true . Only present on update and remove . |
key_pretty string |
Prettified version of complex (Pair) keys where all elements are concatenated using # . Same as key or key_unpacked otherwise. Only present on update and remove . |
value object |
Unboxed version of the bigmap value, either a simple value or complex nested structure using scalar types, lists, sets, maps, and bigmaps. Only present on update . |
value_unpacked object |
An unpacked version of any packed binary data contained in the value. This can be a scalar type or a Michelson primitive tree if the type is complex such as lambda, pair, etc. Only present on update . |
key_type object |
Michelson JSON encoded representation of bigmap key type. Only present on alloc and copy . |
value_type object |
Michelson JSON encoded representation of bigmap value type. Only present on alloc and copy . |
source_big_map int64 |
Source bigmap id. Only present on copy . |
destination_big_map int64 |
Source bigmap id. Only present on copy . |
meta object |
Metadata for the current bigmap entry. |
contract hash |
Contract that owns the bigmap. |
bigmap_id int64 |
Unique on-chain id of this bigmap. |
time datetime |
Update timestamp for this key/value pair. |
height int64 |
Update height for this key/value pair. |
block hash |
Hash of the block containing the latest update. |
is_replaced bool |
Flag indicating if a future update has overwritten the current value. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
is_removed bool |
Flag indicating if a future remove action has deleted the current key. Useful in combination with the block parameter that allows to query a value at a fixed block in history. |
prim object |
Native Michelson JSON encoded key and value as primitive tree. Optional, use prim to enable. |
Get Contract Creator
GET https://api.tzstats.com/explorer/contract/{hash}/creator
Returns the originator account of this contract. This endpoint was called ../manager
before.
Cycles
Example request.
curl "https://api.tzstats.com/explorer/cycle/head"
Example response.
{
"cycle": 247,
"start_height": 1011713,
"end_height": 1015808,
"start_time": "2020-06-25T03:36:14Z",
"end_time": "2020-06-27T23:54:04Z",
"progress": 13.2568359375,
"is_complete": false,
"is_snapshot": false,
"is_active": true,
"snapshot_height": -1,
"snapshot_index": -1,
"snapshot_time": "0001-01-01T00:00:00Z",
"rolls": 84176,
"roll_owners": 423,
"active_delegators": 54434,
"active_bakers": 447,
"staking_supply": 674670196.013393,
"staking_percent": 80.2706912175752,
"working_bakers": 117,
"working_endorsers": 300,
"missed_priorities": 4,
"missed_endorsements": 115,
"n_double_baking": 0,
"n_double_endorsement": 0,
"n_orphans": 0,
"solvetime_min": 60,
"solvetime_max": 100,
"solvetime_mean": 60.327808471454915,
"priority_min": 0,
"priority_max": 1,
"priority_mean": 0.007366482504604053,
"endorsement_rate": 99.33694649446494,
"endorsements_min": 25,
"endorsements_max": 32,
"endorsements_mean": 31.78782287822878,
"seed_rate": 100,
"worst_baked_block": 1011950,
"worst_endorsed_block": 1011819,
"snapshot_cycle": {
// ... same data as cycle
},
"follower_cycle": {
// ... same data as cycle
}
}
Provides information about a consensus cycle, the past roll snapshot cycle and the future cycle whose rights are determined by the current cycle. This endpoint accepts head
and a cycle number
as path parameters.
HTTP Request
GET https://api.tzstats.com/explorer/cycle/{head,number}
HTTP Response
Field | Description |
---|---|
cycle int64 |
The cycle number. |
start_height int64 |
First block height (level) in this cycle. |
end_height int64 |
Last block height (level) in this cycle. |
start_time datetime |
Start time (estimate for future cycles). |
end_time datetime |
End time (estimate for open and future cycles). |
progress float |
Cycle completion in percent. |
is_complete bool |
Flag indicating the cycle is complete. |
is_snapshot bool |
Flag indicating a roll snapshot has been selected. |
is_active bool |
Flag indicating the cycle is currently active. |
snapshot_height int64 |
Height of the snapshot block. |
snapshot_index int64 |
Index of the snapshot block. |
snapshot_time datetime |
Time the snapshot block was taken. |
rolls int64 |
Number of rolls at selected snapshot block or most recent snapshot block. |
roll_owners int64 |
Number of unique roll owners (delegates) at selected snapshot block or most recent snapshot block. |
staking_supply money |
Total staked supply at selected snapshot block or most recent snapshot block. |
staking_percent float |
Percent of total supply staked at selected snapshot block or most recent snapshot block. |
active_bakers int64 |
Number of actively registered bakers. |
active_delegators int64 |
Number of non-zero accounts delegating to active bakers. |
working_bakers int64 |
Number of bakers seen during this cycle. Its expected for this number to be lower than active_bakers because some may have no rolls, others may not contribute. |
working_endorsers int64 |
Number of unique endorsers seen during this cycle. Its expected for this number to be lower than active_bakers because some may have no rolls, others may not contribute. |
missed_priorities int64 |
Total count of missed block priorities. |
missed_endorsements int64 |
Total count of missed endorsement slots. |
n_double_baking int64 |
Count of double_baking_evidence events. |
n_double_endorsement int64 |
Count of double_endorsement_evidence events. |
n_orphans int64 |
Number of orphan blocks in this cycle. |
solvetime_min int64 |
Minimum time between blocks. |
solvetime_max int64 |
Maximum time between blocks. |
solvetime_mean float |
Mean time between blocks. |
priority_min int64 |
Minimum block priority. |
priority_max int64 |
Maximum block priority. |
priority_mean float |
Mean block priority. |
endorsement_rate float |
Percentage of seen endorsements vs expected endorsements. |
endorsements_min int64 |
Minimum count of endorsements across all blocks. |
endorsements_max int64 |
Maximum count of endorsements across all blocks. |
endorsements_mean float |
Mean count of endorsements across all blocks. |
seed_rate int64 |
Percentage of published vs expectd seed_nonce_revelations . |
worst_baked_block int64 |
Height of the block with lowest priority. |
worst_endorsed_block int64 |
Height of the block with least endorsed slots. |
snapshot_cycle object |
Embedded cycle data for the cycle that provided the roll snapshot for the current cycle. |
follower_cycle object |
Embedded cycle data for the future cycle that will get its rights assigned from a snapshot in the current cycle. |
Elections
Example request.
curl "https://api.tzstats.com/explorer/election/head"
Example response.
{
"election_id": 13,
"num_periods": 4,
"num_proposals": 2,
"start_time": "2019-07-16T19:02:34Z",
"end_time": "2019-10-18T00:29:57Z",
"start_height": 524288,
"end_height": 655359,
"is_empty": false,
"is_open": true,
"is_failed": false,
"no_quorum": false,
"no_majority": false,
"no_proposal": false,
"voting_period": "promotion_vote",
"proposal": {
"voting_period": 15,
"voting_period_kind": "proposal",
"period_start_time": "2019-07-16T19:02:34Z",
"period_end_time": "2019-08-09T06:46:57Z",
"period_start_block": 524288,
"period_end_block": 557055,
"eligible_rolls": 70159,
"eligible_voters": 461,
"quorum_pct": 0,
"quorum_rolls": 0,
"turnout_rolls": 43133,
"turnout_voters": 225,
"turnout_pct": 6147,
"turnout_ema": 0,
"yay_rolls": 0,
"yay_voters": 0,
"nay_rolls": 0,
"nay_voters": 0,
"pass_rolls": 0,
"pass_voters": 0,
"is_open": false,
"is_failed": false,
"is_draw": false,
"no_proposal": false,
"no_quorum": false,
"no_majority": false,
"proposals": [
{
"hash": "PsBABY5nk4JhdEv1N1pZbt6m6ccB9BfNqa23iKZcHBh23jmRS9f",
"source": "tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8",
"block_hash": "BLkbt55K5YZMPtjrSfo3ericxRaeXcwEwawfE5BkT9H5ZbZnLQV",
"op_hash": "op4mZHRe1xTmYG34xYRwpGaGMAfTp6S82eeebgNZmdtNW6szeeX",
"height": 537802,
"time": "2019-07-26T13:20:04Z",
"rolls": 19964,
"voters": 146
},
{
"hash": "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
"source": "tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8",
"block_hash": "BLzSKKWp9NyrNrZrZgWin3m2zjPVUJfxNn1QkCzt9aZy7ZLWgJJ",
"op_hash": "ooDAtGzFBeRUJcEK3QRBHU3kzk31CAp2RARYE3kmU3qsrvgs8JN",
"height": 547386,
"time": "2019-08-02T09:42:56Z",
"rolls": 66302,
"voters": 304
}
]
},
"testing_vote": {
"voting_period": 16,
"voting_period_kind": "testing_vote",
"period_start_time": "2019-08-09T06:48:02Z",
"period_end_time": "2019-09-01T17:52:51Z",
"period_start_block": 557056,
"period_end_block": 589823,
"eligible_rolls": 70585,
"eligible_voters": 464,
"quorum_pct": 7291,
"quorum_rolls": 51463,
"turnout_rolls": 57818,
"turnout_voters": 179,
"turnout_pct": 8191,
"turnout_ema": 0,
"yay_rolls": 37144,
"yay_voters": 171,
"nay_rolls": 0,
"nay_voters": 0,
"pass_rolls": 20674,
"pass_voters": 8,
"is_open": false,
"is_failed": false,
"is_draw": false,
"no_proposal": false,
"no_quorum": false,
"no_majority": false,
"proposals": [
{
"hash": "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
"source": "tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8",
"block_hash": "BLzSKKWp9NyrNrZrZgWin3m2zjPVUJfxNn1QkCzt9aZy7ZLWgJJ",
"op_hash": "ooDAtGzFBeRUJcEK3QRBHU3kzk31CAp2RARYE3kmU3qsrvgs8JN",
"height": 547386,
"time": "2019-08-02T09:42:56Z",
"rolls": 0,
"voters": 0
}
]
},
"testing": {
"voting_period": 17,
"voting_period_kind": "testing",
"period_start_time": "2019-09-01T17:53:51Z",
"period_end_time": "2019-09-25T04:30:36Z",
"period_start_block": 589824,
"period_end_block": 622591,
"eligible_rolls": 71053,
"eligible_voters": 469,
"quorum_pct": 0,
"quorum_rolls": 0,
"turnout_rolls": 0,
"turnout_voters": 0,
"turnout_pct": 0,
"turnout_ema": 0,
"yay_rolls": 0,
"yay_voters": 0,
"nay_rolls": 0,
"nay_voters": 0,
"pass_rolls": 0,
"pass_voters": 0,
"is_open": false,
"is_failed": false,
"is_draw": false,
"no_proposal": false,
"no_quorum": false,
"no_majority": false,
"proposals": [
{
"hash": "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
"source": "tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8",
"block_hash": "BLzSKKWp9NyrNrZrZgWin3m2zjPVUJfxNn1QkCzt9aZy7ZLWgJJ",
"op_hash": "ooDAtGzFBeRUJcEK3QRBHU3kzk31CAp2RARYE3kmU3qsrvgs8JN",
"height": 547386,
"time": "2019-08-02T09:42:56Z",
"rolls": 0,
"voters": 0
}
]
},
"promotion_vote": {
"voting_period": 18,
"voting_period_kind": "promotion_vote",
"period_start_time": "2019-09-25T04:32:51Z",
"period_end_time": "2019-10-18T00:28:57Z",
"period_start_block": 622592,
"period_end_block": 655359,
"eligible_rolls": 71840,
"eligible_voters": 463,
"quorum_pct": 7471,
"quorum_rolls": 53671,
"turnout_rolls": 11895,
"turnout_voters": 79,
"turnout_pct": 1655,
"turnout_ema": 0,
"yay_rolls": 11044,
"yay_voters": 71,
"nay_rolls": 844,
"nay_voters": 6,
"pass_rolls": 7,
"pass_voters": 2,
"is_open": true,
"is_failed": false,
"is_draw": false,
"no_proposal": false,
"no_quorum": false,
"no_majority": false,
"proposals": [
{
"hash": "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
"source": "tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8",
"block_hash": "BLzSKKWp9NyrNrZrZgWin3m2zjPVUJfxNn1QkCzt9aZy7ZLWgJJ",
"op_hash": "ooDAtGzFBeRUJcEK3QRBHU3kzk31CAp2RARYE3kmU3qsrvgs8JN",
"height": 547386,
"time": "2019-08-02T09:42:56Z",
"rolls": 0,
"voters": 0
}
]
}
}
On-chain elections can be queried by proposal hash
or sequence number
. An election contains a complete set of data on a past or the currently ongoing (head
) on-chain voting process, including up to four voting periods. Voting periods may be empty when no proposal has been published. Only the last voting period of the last election is open at eny point in time. Ballots represent the individual ballot operations sent by bakers during votes or the upvotes to a proposal during the first voting period.
HTTP Request
GET https://api.tzstats.com/explorer/election/{head,hash,number}
HTTP Response
Field | Description |
---|---|
election_id int64 |
Sequence number of the election. |
num_periods int64 |
Number of voting periods activated during this election (min 1, max 4) |
num_proposals int64 |
Total number of submitted proposals. |
start_time int64 |
Time of the first block in the election. |
end_time int64 |
Time of the last block in the election (when open this is an approximation of the latest possible end assuming all voting periods are used and all remaining blocks are produced at priority zero). |
start_height int64 |
First block of the election period. |
end_height bool |
Last block of the election (when open this is an approximation of the full duration assuming all voting periods are used). |
is_empty bool |
Flag indicating the election has not seen and proposal being submitted. |
is_open bool |
Flag indicating the election is ongoing. |
is_failed bool |
Flag indicating the election has failed to select or activate a new protocol. |
no_quorum bool |
Flag indicating the election has failed because no quorum could be reached. |
no_majority bool |
Flag indicating the election has failed because no majority could be reached. |
no_proposal bool |
Flag indicating the election has failed because no proposal has been submitted. |
voting_period enum |
Period kind proposal , testing_vote , testing , promotion_vote . |
proposal object |
Vote object for the proposal period 1 (see below). |
testing_vote object |
Vote object for the testing vote period 2 (see below). |
testing object |
Vote object for the testing period 3 (see below). |
promotion_vote object |
Vote object for the promotion vote period 4 (see below). |
Voting Period Object
Field | Description |
---|---|
voting_period int64 |
Protocol-level voting period counter. |
voting_period_kind enum |
Period kind proposal , testing_vote , testing , promotion_vote . |
period_start_time datetime |
Time of the first block in the voting period. |
period_end_time datetime |
Time of the last block in the voting period (when open this is an approximation of the latest possible end assuming all remaining blocks are produced at priority zero). |
period_start_block int64 |
First block of the voting period. |
period_end_block int64 |
Last block of the voting period. |
eligible_rolls int64 |
Number of rolls eligible to vote snapshot at start of the voting period. |
eligible_voters int64 |
Number of eligible voters (delegates) snapshot at start of the voting period. |
quorum_pct float |
Required quorum in percent. |
quorum_rolls int64 |
Required rolls to reach quorum. |
turnout_rolls int64 |
Actual rolls who voted. |
turnout_voters int64 |
Actual voters who voted. |
turnout_pct float |
Actual participation in percent. |
turnout_ema float |
Moving average for Babylon v005 quorum algorithm. |
yay_rolls int64 |
Number of Yay rolls. |
yay_voters int64 |
Number of Yay voters. |
nay_rolls int64 |
Number of Nay rolls. |
nay_voters int64 |
Number of Nay voters. |
pass_rolls int64 |
Number of Pass rolls. |
pass_voters int64 |
Number of Pass voters. |
is_open bool |
Flag indicating the voting period is currently open. |
is_failed bool |
Flag indicating the voting period has failed to select or activate a new protocol. |
is_draw bool |
Flag indication the reason for failure was a draw between two proposals in the proposal period. |
no_proposal bool |
Flag indication the reason for failure was no submitted proposal in the proposal period. |
no_quorum bool |
Flag indication the reason for failure was participation below the required quorum. |
no_majority bool |
Flag indication the reason for failure was acceptance below the required supermajority. |
proposals array |
List of submitted proposals (in proposal period) or the selected proposal. |
Proposal Object
Field | Description |
---|---|
hash hash |
Protocol hash. |
source hash |
Sender account. |
block_hash hash |
Proposal operation block hash. |
op_hash hash |
Proposal operation hash. |
height int64 |
Proposal operation submission height. |
time datetime |
Proposal operation submission time. |
rolls int64 |
Count of rolls voting for this proposal during the proposal period. |
voters int64 |
Count of voters voting for this proposal during the proposal period. |
List Voters
GET https://api.tzstats.com/explorer/election/{hash,number,head}/{stage}/voters
Lists all eligible voters for the current voting period where stage
is the sequence number of the voting period [1..4]
. The voter list supports pagination with limit
, offset
and cursor
. To change the order of returned calls use the optional order
(asc|desc) parameter.
Voter Object
Field | Description |
---|---|
row_id int64 |
Internal account id for use with cursor . |
address hash |
Voter address. |
rolls int64 |
Count of rolls the voter has during this voting period. |
stake money |
Staking balance the voter had at the beginning of this voting period. |
has_voted bool |
Flag indicating if the account has already voted. |
ballot enum |
Ballot cast by the voter, either yay , nay or pass . |
proposals array |
List of proposals (as hashes) the voter voted for. |
List Ballots
GET https://api.tzstats.com/explorer/election/{hash,number,head}/{stage}/ballots
Lists all ballots cast during the current voting periodwhere stage
is the sequence number of the voting period [1..4]
. The voter list supports pagination with limit
, offset
and cursor
. To change the order of returned calls use the optional order
(asc|desc) parameter.
Ballot Object
Field | Description |
---|---|
row_id int64 |
Internal account id for use with cursor . |
sender hash |
Voter address. |
height int64 |
Operation submission height. |
time datetime |
Operation submission time. |
election_id int64 |
Sequence number of the election. |
voting_period int64 |
Protocol-level voting period counter. |
voting_period_kind enum |
Period kind proposal , testing_vote , testing , promotion_vote . |
proposal hash |
Hash of the proposal the voter voted for. If the vote happend during the proposal period and the voter used to vote for multiple proposals either in a single proposals operation or with multiple proposals operations, multiple ballots exist. |
op hash |
Operation hash. |
ballot enum |
Ballot cast by the voter, either yay , nay or pass . During proposal period the ballot is always yay to decribe the only choice. |
rolls int64 |
Count of rolls the voter has during this voting period. |
Indexer Status
Example request.
curl "https://api.tzstats.com/explorer/status"
Example response.
{
"mode": "sync",
"status": "synced",
"blocks": 626399,
"indexed": 626399,
"progress": 1
}
Returns the current indexer status, useful to check of the indexer is in sync with the blockchain.
HTTP Request
GET https://api.tzstats.com/explorer/status
HTTP Response
Field | Description |
---|---|
mode enum |
Chain crawling mode (sync = live monitoring). |
status enum |
Indexer status (connecting , syncing , synced , failed ). |
blocks int64 |
Most recent block height seen by the connected Tezos node. |
indexed int64 |
Most recent block height indexed. |
progress float |
Percentage of blocks indexed. |
Market Tickers
Example request.
curl "https://api.tzstats.com/markets/tickers"
Example response.
[
{
"pair": "XTZ_BNB",
"base": "XTZ",
"quote": "BNB",
"exchange": "binance",
"open": 0.05813000,
"high": 0.06058000,
"low": 0.05583000,
"last": 0.05741000,
"change": -1.23860313,
"vwap": 0.05787292,
"n_trades": 176,
"volume_base": 17373.80000000,
"volume_quote": 1005.47257300,
"timestamp": "2019-09-29T20:14:00.001014458Z"
},
{
"pair": "XTZ_BTC",
"base": "XTZ",
"quote": "BTC",
"exchange": "kraken",
"open": 0.00011090,
"high": 0.00011300,
"low": 0.00010710,
"last": 0.00010970,
"change": -1.08205591,
"vwap": 0.00011036,
"n_trades": 808,
"volume_base": 219356.80514484,
"volume_quote": 24.20907256,
"timestamp": "2019-09-29T20:14:00.000755843Z"
}
]
Fetches a list of market price tickers with 24h OHLCV data.
HTTP Request
GET https://api.tzstats.com/markets/tickers
HTTP Response
Field | Description |
---|---|
pair string |
Trading pair in format {base}_{quote} . |
base string |
Base currency (always XTZ ). |
quote string |
Quote currency. |
exchange string |
Exchange code. |
open money |
24h open price in quote currency. |
high money |
24h highest price in quote currency. |
low money |
24h lowest price in quote currency. |
last money |
Last price in quote curreny. |
change float |
24h price change in percent. |
vwap money |
24h volume weighted average price in quote currency. |
n_trades int64 |
24h number of trades. |
volume_base money |
24h traded volume in base currency. |
volume_quote money |
24h traded volume in quote currency. |
timestamp datetime |
Timestamp of the ticker result. |
Operations
Example request.
curl "https://api.tzstats.com/explorer/op/opSrt7oYHDTZcfGnhNt3BzGrrCQf364VuYmKo5ZQVQRfTnczjnf"
Example response.
[
{
"row_id": 28086947,
"hash": "opSrt7oYHDTZcfGnhNt3BzGrrCQf364VuYmKo5ZQVQRfTnczjnf",
"type": "transaction",
"block": "BL1PGezBat3BX1N2rnk1qycTJbCXdWJwYoGBChyeFyYJABGLyZ9",
"time": "2020-06-25T06:18:19Z",
"height": 1011875,
"cycle": 247,
"counter": 2187104,
"op_n": 22,
"op_l": 3,
"op_p": 3,
"op_c": 0,
"op_i": 0,
"status": "applied",
"is_success": true,
"is_contract": false,
"gas_limit": 15385,
"gas_used": 10207,
"gas_price": 0.17557,
"storage_limit": 257,
"storage_size": 0,
"storage_paid": 0,
"volume": 0.040128,
"fee": 0.001792,
"reward": 0,
"deposit": 0,
"burned": 0,
"is_internal": false,
"has_data": false,
"days_destroyed": 0.016302,
"sender": "tz1Ywgcavxq9D6hL32Q2AQWHAux9MrWqGoZC",
"receiver": "tz1ijyJy2QncvgDKZJARDgPqEYVRk6yTE5d7",
"branch_height": 1011874,
"branch_depth": 1,
"branch": "BKt5Lz42YyZNaSYkqfx3m9cmZ2qRoqw1duHqvygLUrgxCewYXoS",
"is_implicit": false,
"entrypoint_id": 0,
"is_orphan": false,
"is_batch": true,
"is_sapling": false
},
// ...
]
Returns info about a single operation or a list of related operations. Because Tezos supports batch operations (multiple operations sharing the same hash), internal operations (created by smart contract calls in response to a transaction) and implicit events (state changes that do not have an operation hash) this endpoint always returns an array of operation objects. In many cases this array contains one element only. Use the optional prim
(boolean) parameter to embed Michelson primitive trees with smart contract calls. Use meta
(boolean) to add optional account metadata.
HTTP Request
GET https://api.tzstats.com/explorer/op/{hash|id}
HTTP Response
Field | Description |
---|---|
hash hash |
Operation hash. |
type enum |
Operation type. |
block hash |
Block hash at which the operation was included on-chain. |
time datetime |
Block time at which the operation was included on-chain. |
height int64 |
Block height at which the operation was included on-chain. |
cycle int64 |
Cycle in which the operation was included on-chain. |
counter int64 |
Unique sender account ‘nonce’ value. |
op_n int64 |
In block operation counter. |
op_l int64 |
Tezos RPC operation list number (0..3). |
op_p int64 |
Tezos RPC operation list position. |
op_c int64 |
Bulk operation list position. |
op_i int64 |
Internal operation list position. |
status enum |
Operation status applied , failed , backtracked , skipped . |
is_success bool |
Flag indicating operation was successfully applied. |
is_contract bool |
Flag indicating smart-contract calls. |
gas_limit int64 |
Caller-defined gas limit. |
gas_used int64 |
Gas used by the operation. |
gas_price float |
Effective price per gas unit in mutez. |
storage_limit int64 |
Caller-defined storage limit. |
storage_size int64 |
Actual storage size allocated. |
storage_paid int64 |
Part of the storage the operation paid for. |
volume money |
Amount of tokens transferred in tz. In denunciation operations, this field contains the accuser reward, in delegation operations this field contains the initially delegated balance. |
fee money |
Fees paid in tz. In denunciation operations, this field contains the offender loss as negative value. |
reward money |
Rewards earned in tz. In denunciation operations, this field contains the offender loss as negative value. |
deposit money |
Amount of deposited tokens in tz. In denunciation operations, this field contains the offender loss as negative value. |
burned money |
Amount of burned tokens in tz. |
is_internal bool |
Flag indicating if this operation was sent be a smart contract. |
is_implicit bool |
Flag indicating implicit on-chain events, ie. state changes that don’t have an operation hash such as bake , unfreeze , seed_slash , airdrop and invoice . |
has_data bool |
Flag indicating if extra data or parameters are present. |
data polymorph |
Extra type-dependent operation data. See below. |
parameters object |
Call parameters as embedded JSON object, contract-only. |
storage object |
Updated contract storage as embedded JSON object, contract-only. |
big_map_diff object |
Inserted, updated or deleted bigmap entries as embedded JSON object, contract-only. |
days_destroyed float |
Token days destroyed by this operation (tokens transferred * token idle time ). |
parameters object |
Contract call parameters. |
storage object |
Updated version of contract storage after call. |
data object |
Extra operation data (see below for content encoding). |
big_map_diff array |
List of bigmap updates. |
errors array |
Native Tezos RPC errors. |
sender hash |
Operation sender. |
receiver hash |
Transaction receiver, may be empty. For activate_account the source account is referenced when the activation merged coins from a second blinded account (ie. when a fundraiser signed up twice). For delegation the previous delegate is referenced. For seed_nonce_revelation the actual seed publisher is referenced. |
delegate hash |
New Delegate, only used by origination and delegation . When empty for a delegation the operation was a delegate withdrawal. |
creator hash |
Contains contract creator on origination . For internal transactions , the original sender of the external transaction is referenced. |
branch_height int64 meta-arg |
Height of the branch block this op refers to. |
branch_depth int64 meta-arg |
Count of blocks between branch block and block including this op. |
branch hash meta-arg |
Block hash of the branch this op refers to. |
entrypoint_id int64 |
Serial id of the called entrypoint, only relevant if the operation was a transaction, the receiver is a smart contract and call parameters are present. |
is_orphan bool |
Flag indicating whether this operation was orphaned (not included in any block). |
is_batch bool |
Flag indicating if this operation is part of a batch operation list. |
batch_volume money |
Total amount transferred in a batch operation list. Only available of the first operation of a batch list and only when any transfers happened. |
metadata object |
Use meta=1 to embed optional account metadata for sender, receiver, delegate, creator. May be empty if no account has metadata defined. |
List of supported operation types
activate_account
double_baking_evidence
double_endorsement_evidence
seed_nonce_revelation
transaction
origination
delegation
reveal
endorsement
proposals
ballot
bake
(implict, no hash, block header eventop_n = -1
)unfreeze
(implict, no hash, block header eventop_n = -1
)seed_slash
(implict, no hash, block header eventop_n = -1
)airdrop
(implict, no hash, protocol upgrade eventop_n = -2
)invoice
(implict, no hash, protocol upgrade eventop_n = -2
)migration
(implict, no hash, protocol upgrade eventop_n = -2
)
Decoding Operation Data
Some operations contain extra data in the polymorphic data
field. This field exists when the has_data
flag is true. Decoding the data depends on the operation type
.
Operation | Data Type | Specification |
---|---|---|
activate_account |
string | hex(secret),blinded-address |
endorsement |
uint | 32bit big-endian bitmask identifying endorsed slots |
ballot |
string | proposal-hash,ballot (yay, nay, pass) |
proposals |
string | comma-separated list or proposal hashes |
reveal |
string | public key hash |
seed_nonce_revelation |
string | level,hex(nonce) |
double_baking_evidence |
object | JSON array of double signed block headers |
double_endorsemnt_evidence |
object | JSON array of double signed endorsements |
transaction |
- | unused, see parameters , storage and big_map_diff |
Table Endpoints
Generic Table Query
https://api.tzstats.com/tables/{table_code}.{format}?{args}
Tables store data in tabular form as a set of columns. Each column has a specified type and each row has a unique uint64 row_id
. Empty values are represented as JSON null
or empty strings. Tables can grow extremely large, so its good practice to use filters and the columns
query argument to limit the result size. Table responses are automatically sorted by row_id
. Use client-side sorting if a different sorting order is required.
List of supported tables
Endpoint | Table Content |
---|---|
GET /tables/chain |
running blockchain totals |
GET /tables/supply |
running supply totals |
GET /tables/block |
blocks (including orphans) |
GET /tables/op |
operations (only final) |
GET /tables/account |
most recent account balances and state |
GET /tables/contract |
smart contracts state at creation |
GET /tables/flow |
balance, freezer and delegation flows |
GET /tables/rights |
baking and endorsing rights |
GET /tables/snapshot |
balances of active delegates & delegators at all snapshot blocks |
GET /tables/income |
per-cycle statistics on baker income, efficiency, etc |
GET /tables/election |
election metadata (i.e. entire governance cycles) |
GET /tables/proposal |
individual proposals |
GET /tables/vote |
voting period metadata |
GET /tables/ballot |
ballots and proposal operations |
Query Arguments
Tables support the following general query parameters.
Argument | Description |
---|---|
columns optional |
Comma separated list of column names to return. Bulk array results will be ordered accordingly. Default is all defined columns for a table. |
limit optional |
Maximum number of rows to return. Limited to 50,000, default 500. |
cursor optional |
Id (row_id ) of the latest result row returned by a previous call. |
order optional |
Result order either asc (default) or desc , sorted by row_id . |
To paginate result sets larger than the maximum limit, include row_id
into the list of columns and use the last value of row_id as cursor in your next call. This will automatically apply an extra filter row_id.gt=cursor
for ascending and row_id.lt=cursor
for descending order. You can of course also apply the relevant row_id filter directly, without using cursor.
Query Filters
Filter Example
The example below filters blocks by time range from
time.gte=2019-08-01
(inclusive) totime.lte=2019-08-31
(inclusive) and returns columnstime
andheight
. The same effect can be achieved with the range operatortime.rg=2019-08-01,2019-08-31
.
curl "https://api.tzstats.com/tables/block.json?columns=time,height&time.gte=2018-08-01&time.lte=2018-08-31&limit=50000"
JSON result
[
[1533081657000,42672],
[1533081717000,42673],
[1533081777000,42674],
[1533081837000,42675],
[1533081897000,42676],
[1533081957000,42677],
[1533082017000,42678],
[1533082152000,42679],
[1533082287000,42680],
[1533082347000,42681],
[1533082407000,42682],
// ...
]
To filter tables use filter expressions of the form <column>.<operator>=<arg>
. Filters work on any combination of columns regardless of type. For arguments, type encoding rules of the column type apply. Filtering by multiple columns is similar to a logical AND between expressions. For simplicity and performance there are currently no OR expressions or more complex operators available. Comparison order for strings and binary is the lexicographical order over UTF8 (string) or ASCII (binary) alphabets.
Operator | Semantics |
---|---|
= , .eq= |
Equal. Matches rows where column values match exactly the filter value. |
.ne= |
Not equal. Matches rows where column values do not match the filter value. |
.gt= |
Greater than. matches columns whose value is strictly greater than the filter value. |
.gte= |
Greater than or equal. matches columns whose value is greater than or equal to the filter value. |
.lt= |
Less than. matches columns whose value is strictly smaller than the filter value. |
.lte= |
Less than or equal. matches columns whose value is strictly smaller than or equal to the filter value. |
.in= |
Inclusion in list. matches columns whose value is equal to one of the filter values. Multiple values must be separated by comma. |
.nin= |
Not included in list. matches columns whose value is not equal to one of the filter values. Multiple values may be separated by comma. |
.rg= |
Range. matches columns whose value is between the provided filter values, boundary inclusive. Requires exactly two values separated by comma. (This is similar to, but faster than using .gte= and .lte= in combination.) |
.re= |
Regexp. matches columns whose value matches the regular expression. Can only be used on string-type columns (not enum or hash). Non-URL-safe characters must be properly escaped. |
Account Table
Example request.
curl "https://api.tzstats.com/tables/account?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m"
Example response (comments added for explanation).
[
[
278469, // row_id
278469, // delegate_id
0, // creator_id
"sppk7bn9MKAWDUFwqowcxA1zJgp12yn2kEnMQJP3WmqSZ4W8WQhLqJN" // pubkey
"secp256k1", // address_type
360996, // first_in
360997, // first_out
633203, // last_in
633203, // last_out
360996, // first_seen
633203, // last_seen
0, // delegated_since
361000, // delegate_since
0, // delegate_until
4129917.992000, // total_received
1241985.094354, // total_sent
0.000000, // total_burned
0.041097, // total_fees_paid
488373.754858, // total_rewards_earned
53.292001, // total_fees_earned
0.000000, // total_lost
3029056.000000, // frozen_deposits
94254.999996, // frozen_rewards
10.405040, // frozen_fees
0.000000, // unclaimed_balance
253038.498372, // spendable_balance
28092993.766577, // delegated_balance
13, // total_delegations
8, // active_delegations
1, // is_funded
0, // is_activated
0, // is_delegated
1, // is_revealed
1, // is_delegate
1, // is_active_delegate
0, // is_contract
6165, // blocks_baked
41, // blocks_missed
129, // blocks_stolen
102793, // blocks_endorsed
195539, // slots_endorsed
332, // slots_missed
103002, // n_ops
0, // n_ops_failed
38, // n_tx
1, // n_delegation
0, // n_origination
1, // n_proposal
1, // n_ballot
2, // token_gen_min
4875, // token_gen_max
160, // grace_period
"08c80261", // baker_version
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // address
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // delegate
null, // creator
1553123452000, // first_seen_time
1570032391000, // last_seen_time
1553123452000, // first_in_time
1570032391000, // last_in_time
1553123512000, // first_out_time
0, // delegated_since_time
1553123692000, // delegate_since_time
0, // delegate_until_time
0, // rich_rank
0, // volume_rank
0, // traffic_rank
815436, // next_bake_height
0, // next_bake_priority
1553123692000, // next_bake_time
815397, // next_endorse_height
1553123692000 // next_endorse_time
]
]
List information about the most recent state of implicit and smart contract accounts.
HTTP Request
GET https://api.tzstats.com/tables/account?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
delegate_id uint64 |
Unique row_id of the delegate (baker) this account delegates to. If same as row_id, this is a baker account. |
creator_id uint64 |
Contract creator unique row_id. |
address_type enum |
Account address type ed25519 (tz1), secp256k1 (tz2), p256 (tz3), contract (KT1) or blinded (btz1) |
pubkey hash |
Revealed public key base58check encoded. |
first_in int64 |
Block height of first incoming transaction. |
first_out int64 |
Block height of first outgoing transaction. |
last_in int64 |
Block height of latest incoming transaction. |
last_out int64 |
Block height of latest outgoing transaction. |
first_seen int64 |
Block height of account creation. |
last_seen int64 |
Block height of last activity. |
delegated_since int64 |
Block height of most recent delegation. |
delegate_since int64 |
Block height of registration as delegate (baker). |
delegate_until int64 |
Block height of most recent deactivation as delegate (baker). |
total_received money |
Lifetime total tokens received in transactions. |
total_sent money |
Lifetime total tokens sent in transactions. |
total_burned money |
Lifetime total tokens burned in tz. |
total_fees_paid money |
Lifetime fees paid in tz. |
total_rewards_earned money |
Lifetime rewards earned in tz. |
total_fees_earned money |
Lifetime fees earned in tz. |
total_lost money |
Lifetime total tokens lost in tz. |
frozen_deposits money |
Currently frozen deposits |
frozen_rewards money |
Currently frozen rewards. |
frozen_fees money |
Currently frozen fees. |
unclaimed_balance money |
Currently unclaimed balance (for vesting contracts and commitments). |
spendable_balance money |
Currently spendable balance. |
delegated_balance money |
(baker only) Current incoming delegations. |
total_delegations int64 |
(baker only) Lifetime count of delegations. |
active_delegations int64 |
(baker only) Currently active and non-zero delegations. |
is_funded bool |
Flag indicating the account is funded. |
is_activated bool |
Flag indicating the account was activated from a commitment. |
is_delegated bool |
Flag indicating the account is currently delegated. |
is_revealed bool |
Flag indicating the account has a revealed public key . |
is_delegate bool |
Flag indicating the account is a registered delegate. |
is_active_delegate bool |
Flag indicating the account is a registered and active delegate. |
is_contract bool |
Flag indicating the account is a smart contract. |
blocks_baked int64 |
Lifetime total blocks baked. |
blocks_missed int64 |
Lifetime total block baking missed. |
blocks_stolen int64 |
Lifetime total block baked at priority > 0. |
blocks_endorsed int64 |
Lifetime total blocks endorsed. |
slots_endorsed int64 |
Lifetime total endorsemnt slots endorsed. |
slots_missed int64 |
Lifetime total endorsemnt slots missed. |
n_ops int64 |
Lifetime total number of operations sent and received. |
n_ops_failed int64 |
Lifetime total number of operations sent that failed. |
n_tx int64 |
Lifetime total number of transactions sent and received. |
n_delegation int64 |
Lifetime total number of delegations sent. |
n_origination int64 |
Lifetime total number of originations sent. |
n_proposal int64 |
Lifetime total number of proposals (operations) sent. |
n_ballot int64 |
Lifetime total number of ballots sent. |
token_gen_min int64 |
Minimum generation number of all tokens owned. |
token_gen_max int64 |
Maximum generation number of all tokens owned. |
grace_period int64 |
(baker only) Current grace period before deactivation. |
baker_version string |
(baker only) Git hash of software version run to generate the most recent block (from block nonce). |
address hash |
Account address base58check encoded. |
delegate hash |
Account delegate address base58check encoded. |
creator hash |
Account creator address base58check encoded. |
first_seen_time datetime |
Block time of account creation. |
last_seen_time datetime |
Block time of last activity. |
first_in_time datetime |
Block time of first incoming transaction. |
last_in_time datetime |
Block time of latest incoming transaction. |
first_out_time datetime |
Block time of first outgoing transaction. |
last_out_time datetime |
Block time of latest outgoing transaction. |
delegated_since_time datetime |
Block time of most recent delegation. |
delegate_since_time datetime |
Block time of registration as delegate. |
delegate_until_time datetime |
Block time of the most recent baker deactivation. |
rich_rank int64 |
Global rank on rich list by total balance. |
volume_rank int64 |
Global rank on 1D most active accounts by transactions sent/received. |
traffic_rank int64 |
Global rank on 1D most active accounts by volume sent/received. |
next_bake_height int64 |
Height of next block baking right. |
next_bake_priority int64 |
Priority of next baking right (fixed at zero currently). |
next_bake_time datetime |
Approximate time of next block baking right. |
next_endorse_height int64 |
Height of next block endorsing right. |
next_endorse_time datetime |
Approximate time of next block endorsing right. |
Ballot Table
Example request.
curl "https://api.tzstats.com/tables/ballot?voting_period=16&limit=1"
Example response (comments added for explanation).
[
[
856, // row_id
13, // election_id
5, // proposal_id
16, // voting_period
"testing_vote", // voting_period_kind
557061, // height
1565333732000, // time
63795, // source_id
13150288, // op_id
6, // rolls
"yay", // ballot
"tz1abmz7jiCV2GH2u81LRrGgAFFgvQgiDiaf", // source
"onw6yGKFPucybjz5ysTRoohdnZMt9UFkTo6RdUFe7vcMp5aGv4s", // op
"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU" // proposal
]
]
List individual ballot operations sent by bakers during votes.
HTTP Request
GET https://api.tzstats.com/tables/ballot?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
election_id uint64 |
Unique row_id of the election this proposal was submitted in. |
proposal_id uint64 |
Unique row_id of the proposal that is voted for. |
voting_period int64 |
On-chain sequence number of the voting period this ballot was cast at. |
voting_period_kind enum |
Type of the voting period proposal , testing_vote , testing , promotion_vote . |
height int64 |
Block height where the ballot was included |
time datetime |
Block time where the ballot was included. |
source_id uint64 |
Unique row_id if the ballot sender account. |
op_id uint64 |
Unique row_id if the ballot operation. |
rolls int64 |
Number of rolls owned by source. |
ballot enum |
The actual ballot yay , nay , pass . |
source hash |
Address of the ballot sender account, base58check encoded. |
op hash |
Hash of the ballot operation, base58check encoded. |
proposal hash |
Hash of the proposal that is voted on, if any. |
Bigmap Table
Example request.
curl "https://api.tzstats.com/tables/bigmap?action=alloc&limit=1&order=desc"
Example response (comments added for explanation).
[
[
861, // row_id
0, // prev_id
343647, // account_id
117, // contract_id
16616273, // op_id
682374, // height
1573054617000, // time
15, // bigmap_id
"alloc", // action
"", // key_hash
"bytes", // key_encoding
"address", // key_type
"", // key
"036a", // value
0, // is_replaced
0, // is_deleted
0, // is_copied
"KT1AajLnzG5EyJSZfpSsn44iaHhwdm5AK85b", // address
"oor9UypoAjKYei6miVWhxKVeBhkJV1WH3k1VvzdEBnQFmpPUMaK" // op
]
]
Lists individual bigmap update operations found in smart contract call results. Use this table to search of filter updates or efficiently access updated data. You can also use the results to reconstruct bigmap state at the client from a sequence of updates. For convenience, the current or past state of a bigmap is available as a set of explorer endpoints.
HTTP Request
GET https://api.tzstats.com/tables/bigmap?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
prev_id uint64 |
Unique row identifier of previous value that has been replaced by this row. |
account_id uint64 |
Unique row_id of the account that owns the updated bigmap. |
contract_id uint64 |
Unique row_id of the contract that owns the updated bigmap. |
op_id uint64 |
Unique row_id of the operation that contains this update. |
height int64 |
Height at which the update was included on-chain. |
time datetime |
Timestamp at which the update was included on-chain. |
bigmap_id int64 |
Unique on-chain id of the bigmap. |
action enum |
Update action, one of alloc , update , remove , copy . |
key_hash string |
Script expression hash of the key that was updated. Empty on alloc and copy. |
key_encoding enum |
Michelson encoding of the key (string , bytes , int ). |
key_type enum |
Michelson type of the key. |
key string |
Native representation of the key. Integers are bigints wrapped in strings, other types are rendered according to type rules, e.g. addresses, keys and signatures are base58check encoded). |
value string |
Binary encoding of the Micheline primitives in Babylon format. Wrapped into a hex string. |
is_replaced bool |
Flag indicating this entry has been replaced by a newer entry. |
is_deleted bool |
Flag indicating this key has been deleted by this update. |
is_copied bool |
Flag indicating this key has been copied by this update. |
address hash |
Address of the bigmap owner. |
op hash |
Operation hash where this updated appeared on-chain. |
Block Table
Example request.
curl https://api.tzstats.com/tables/block?time.gte=today&limit=1
Example response (comments added for explanation).
[
[
632250, // row_id
632249, // parent_id
"BMapnMicyiqFsWU9NdqXvfQJQcpFfzWHMicRRjALEMNngkefd7B", // hash
0, // is_orphan
632249, // height
154, // cycle
0, // is_cycle_snapshot
1569974422000, // time
60, // solvetime
4, // version
4, // validation_pass
20007610, // fitness
0, // priority
"d74e7b6dbd050900", // nonce
"promotion_vote", // voting_period_kind
35034, // baker_id
4294967295, // endorsed_slots
32, // n_endorsed_slots
30, // n_ops
0, // n_ops_failed
0, // n_ops_contract
2, // n_tx
0, // n_activation
0, // n_seed_nonce_revelation
0, // n_double_baking_evidence
0, // n_double_endorsement_evidence
27, // n_endorsement
0, // n_delegation
1, // n_reveal
0, // n_origination
0, // n_proposal
0, // n_ballot
10529.635160, // volume
0.004140, // fee
80.000000, // reward
2560.000000, // deposit
0.000000, // unfrozen_fees
0.000000, // unfrozen_rewards
0.000000, // unfrozen_deposits
0.000000, // activated_supply
0.000000, // burned_supply
31, // n_accounts
0, // n_new_accounts
0, // n_new_implicit
0, // n_new_managed
0, // n_new_contracts
0, // n_cleared_accounts
0, // n_funded_accounts
32100, // gas_limit
30414, // gas_used
0.136, // gas_price
0, // storage_size
58.567415, // days_destroyed
1, // n_ops_implicit
100, // pct_account_reuse
"tz1hThMBD8jQjFt78heuCnKxJnJtQo9Ao25X" // baker
]
]
List detailed information about each block, including orphans.
HTTP Request
GET https://api.tzstats.com/tables/block?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
parent_id uint64 |
Unique row id of parent block. |
hash hash |
Block hash. |
is_orphan bool |
Flag indicating the block is an orphan, i.e. not on main chain. |
height int64 |
Block height. |
cycle int64 |
Consensus cycle this block is part of. |
is_cycle_snapshot bool |
Flag indicating this block is a cycle snapshot. |
time datetime |
Block timestamp. |
solvetime int64 |
Duration between the parent block’s timestamp and this block. |
version int64 |
Block protocol version (note, this is a serial version that depends on how many protocols have been activated on the current chain so far). |
validation_pass int64 |
Block validation pass. |
fitness int64 |
Block fitness used to determine longest chain. |
priority int64 |
Baking priority. |
nonce uint64 |
Block nonce. |
voting_period_kind enum |
Current voting period proposal , testing_vote , testing , promotion_vote . |
baker_id uint64 |
Unique row id of the block’s baker account. |
endorsed_slots uint64 |
32bit big-endian bitmask indicating which slots have been endorsed. (Note this field will be set from endorsements published in the subsequent block.) |
n_endorsed_slots int64 |
Count of endorsed slots. (Note this field will be set from endorsements published in the subsequent block.) |
n_ops int64 |
Count of operations contained in this block. |
n_ops_failed int64 |
Count of failed operations. |
n_ops_contract int64 |
Count of smart contract operations (transactions sent to contracts and internal operations sent by contracts). |
n_tx int64 |
Count of transaction operations. |
n_activation int64 |
Count of activate_account operations. |
n_seed_nonce_revelation int64 |
Count of seed_nonce_revelation operations. |
n_double_baking_evidence int64 |
Count of double_baking_evidence operations. |
n_double_endorsement_evidence int64 |
Count of double_endorsement_evidence operations. |
n_endorsement int64 |
Count of endorsement operations. |
n_delegation int64 |
Count of delegation operations. |
n_reveal int64 |
Count of reveal operations. |
n_origination int64 |
Count of origination operations. |
n_proposal int64 |
Count of proposals operations. |
n_ballot int64 |
Count of ballot operations. |
volume money |
Total amount of tokens moved between accounts. |
fee money |
Total fees paid (and frozen) by all operations. |
reward money |
Reward earned (and frozen) by baker. |
deposit money |
Deposit frozen by baker. |
unfrozen_fees money |
Total unfrozen fees (at end of a cycle). |
unfrozen_rewards money |
Total unfrozen rewards (at end of a cycle). |
unfrozen_deposits money |
Total unfrozen deposits (at end of a cycle). |
activated_supply money |
Total amount of commitments activated in tz. |
burned_supply money |
Total amount of tokens burned by operations in tz. |
n_accounts int64 |
Count of accounts seen in this block (i.e. this includes all operation senders, receivers, delegates and the block’s baker). |
n_new_accounts int64 |
Count of new accounts created regardless of type. |
n_new_implicit int64 |
Count of created implicit accounts (tz1/2/3). |
n_new_managed int64 |
Count of created managed accounts (KT1 without code or manager.tz script). |
n_new_contracts int64 |
Count of created smart contracts (KT1 with code). |
n_cleared_accounts int64 |
Count of accounts that were emptied (final balance = 0). |
n_funded_accounts int64 |
Count of accounts that were funded by operations (this includes all new accounts plus previously cleared accounts that were funded again). |
gas_limit int64 |
Total gas limit defined by operations. |
gas_used int64 |
Total gas consumed by operations. |
gas_price float |
Average price of one gas unit in mutez. |
storage_size int64 |
Total sum of new storage allocated by operations. |
days_destroyed float |
Token days destroyed (tokens transferred * token idle time ). |
n_ops_implicit int64 |
Count of implicit protocol events. |
pct_account_reuse float |
Portion of seen accounts that existed before. |
baker hash |
Address of the block baker account, base58check encoded. |
Chain Table
Example request.
curl "https://api.tzstats.com/tables/chain?time.gte=today&limit=1"
Example response (comments added for explanation).
[
[
632250, // row_id
632249, // height
154, // cycle
1569974422000, // time
334414, // total_accounts
309308, // total_implicit
25074, // total_managed
108, // total_contracts
15227175, // total_ops
7139, // total_contract_ops
20774, // total_activations
19559, // total_seed_nonce_revelations
13113009, // total_endorsements
127, // total_double_baking_evidences
24, // total_double_endorsement_evidences
29354, // total_delegations
223262, // total_reveals
26863, // total_originations
1793082, // total_transactions
404, // total_proposals
725, // total_ballots
8747841, // total_storage_bytes
167308, // total_paid_bytes
0, // total_used_bytes
0, // total_orphans
298796, // funded_accounts
10751, // unclaimed_accounts
17567, // total_delegators
17105, // active_delegators
462, // inactive_delegators
3889, // total_delegates
483, // active_delegates
3406, // inactive_delegates
3, // zero_delegates
135, // self_delegates
78, // single_delegates
270, // multi_delegates
72059, // rolls
462 // roll_owners
]
]
List running totals of network-wide statistics. This table is updated at each block.
HTTP Request
GET https://api.tzstats.com/tables/chain?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
height int64 |
Block height the current row refers to. |
cycle int64 |
Cycle the current row refers to. |
time datetime |
Block time in UNIX milliseconds the current row refers to. |
total_accounts int64 |
Total count of existing funded & non-funded accounts. |
total_implicit int64 |
Total count of implicit (tz1/2/3) accounts. |
total_managed int64 |
Total count of managed accounts (KT1) used for delegation (without code / using manager.tz script). |
total_contracts int64 |
Total count of deployed smart contracts. |
total_ops int64 |
Total count of on-chain operations. |
total_contract_ops int64 |
Total count of smart contract calls (sent to or originated from contracts). |
total_activations int64 |
Total count of activate_account operations. |
total_seed_nonce_revelations int64 |
Total count of seed_nonce_revelation operations. |
total_double_endorsement_evidences int64 |
Total count of endorsement operations. |
total_double_baking_evidences int64 |
Total count of double_baking_evidence operations. |
total_double_endorse int64 |
Total count of double_endorsement_evidence operations. |
total_delegations int64 |
Total count of delegation operations. |
total_reveals int64 |
Total count of reveal operations. |
total_originations int64 |
Total count of origination operations. |
total_transactions int64 |
Total count of transaction operations. |
total_proposals int64 |
Total count of proposals operations. |
total_ballots int64 |
Total count of ballot operations. |
total_storage_bytes int64 |
Total count of storage bytes allocated. |
total_paid_bytes int64 |
Total count of storage bytes paid. |
total_used_bytes int64 |
Total count of storage used. |
total_orphans int64 |
Total count of orphaned blocks. |
funded_accounts int64 |
Current number of funded accounts. |
unclaimed_accounts int64 |
Current number of unclaimed fundraiser accounts. |
total_delegators int64 |
Current number of non-zero delegators. |
active_delegators int64 |
Current number of non-zero delegators who delegate to an active delegate. |
inactive_delegators int64 |
Total count of non-zero delegators who delegate to an inactive delegate. |
total_delegates int64 |
Current number of registered bakers (active and inactive). |
active_delegates int64 |
Current number of active bakers. |
inactive_delegates int64 |
Current number of inactive bakers (note: inactive bakers can still have future rights, but won’t get any new rights). |
zero_delegates int64 |
Current number of active bakers with zero staking balance. |
self_delegates int64 |
Current number of active bakers who self-bake only and have no incoming delegations. |
single_delegates int64 |
Current number of active bakers who potentially self-bake and have only a single incoming delegation. |
multi_delegates int64 |
Current number of bakers (potentially staking services) who have more than 1 incoming delegation. |
rolls int64 |
Current number of network-wide rolls. |
roll_owners int64 |
Current number of network-wide roll owners. |
Contract Table
Example | request.
curl "https://api.tzstats.com/tables/contract?address=KT1REHQ183LzfoVoqiDR87mCrt7CLUH1MbcV"
Example response (comments added for explanation).
[
[
28402, // row_id
"KT1Puc9St8wdNoGtLiD2WXaHbWU7styaxYhD", // address
818466, // account_id
813541, // creator_id
1149672, // first_seen
1342907, // last_seen
34600, // storage_size
34608, // storage_paid
"00002e850200002e80050007...", // script
"cf9361e1", // iface_hash
"666dcc01", // code_hash
"000000000000026...", // call_stats
"set_delegate,transfer_tokens", // features
"DEXTER", // interfaces
"tz1P7A3YFgeSsGgopKN9vUU86W3psgTMdtcJ" // creator
]
]
List creation-time information about smart contracts with embedded code and initial storage.
HTTP Request
GET https://api.tzstats.com/tables/contract?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
address hash |
Contract address base58check encoded. |
account_id uint64 |
Unique row_id of related account entry. |
creator_id uint64 |
Manager account row_id (deprecated in v005 Babylon). |
first_seen int64 |
Block height of contract creation. |
last_seen int64 |
Block height of last activity. |
storage_size int64 |
Storage size allocated in bytes. |
storage_paid int64 |
Storage bytes paid for in bytes. |
script bytes |
Binary encoded Michelson script and initial contract storage. |
iface_hash bytes |
Short hash to uniquely identify the contract interface, first 4 bytes of the SHA256 hash over binary encoded Michelson script parameters. |
code_hash bytes |
Short hash to uniquely identify the contract code, first 4 bytes of the SHA256 hash over binary encoded Michelson script code. |
call_stats bytes |
Big-endian uint32 call statistic counters per entrypoint. Only used on smart contracts. |
features string |
Comma separated list of Michelson features used by this contract. Any of account_factory , contract_factory , set_delegate , lambda , transfer_tokens , chain_id , ticket , sapling . |
interfaces string |
Comma separated list of standard interfaces implemented by this contract. Any of MANAGER , SET_DELEGATE , TZIP-005 , TZIP-007 , TZIP-012 , DEXTER , WXTZ_VAULT , KOLIBRI_VAULT (list will be extended). |
creator hash |
Contract creator address base58check encoded. |
Election Table
Example request.
curl "https://api.tzstats.com/tables/election?proposal=PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU"
Example response (comments added for explanation).
[
[
13, // row_id
5, // proposal_id
4, // num_periods
2, // num_proposals
15, // voting_perid
1563303754000, // start_time
0, // end_time
524288, // start_height
0, // end_height
0, // is_empty
1, // is_open
0, // is_failed
0, // no_quorum
0, // no_majority
"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU", // proposal
"promotion_vote" // last_voting_period
]
]
List full details about past and current elections. Elections represent metadata about each consecutive run of related voting periods. Elections may contain 4, 2 or 1 vote periods. They are called empty when only one empty proposal vote without a proposal exists.
HTTP Request
GET https://api.tzstats.com/tables/election?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
proposal_id uint64 |
Unqiue row_id of the winning proposal, if any. |
num_periods int64 |
Election duration in number of voting periods. |
num_proposals int64 |
Total number of submitted proposals. |
voting_perid int64 |
On-chain voting period number. |
start_time datetime |
Block time of election start block. |
end_time datetime |
Block time of election end block. |
start_height int64 |
Block height of election start block. |
end_height int64 |
Block height of election end block. |
is_empty bool |
Flag indicating no proposal was submitted. |
is_open bool |
Flag indicating the election is in progress. |
is_failed bool |
Flag indicating the election has failed to select or activate a new protocol. |
no_quorum bool |
Flag indicating the election has failed because no quorum could be reached. |
no_majority bool |
Flag indicating the election has failed because no majority could be reached. |
proposal hash |
Hash of the proposal that is voted on, if any. |
last_voting_period enum |
Type of the last period at which this election ended proposal , testing_vote , testing , promotion_vote . |
Flow Table
Example request.
curl "https://api.tzstats.com/tables/flow?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m&limit=1"
Example response (comments added for explanation).
[
[
24807689, // row_id
360996, // height
88, // cycle
1553123452000, // time
8361752, // op_id
24, // op_n
0, // op_l
0, // op_p
0, // op_c
0, // op_i
278469, // account_id
31922, // counterparty_id
"secp256k1", // address_type
"balance", // category
"transaction", // operation
2.000000, // amount_in
0.000000, // amount_out
0, // is_fee
0, // is_burned
0, // is_frozen
0, // is_unfrozen
0, // is_shielded
0, // is_unshielded
1, // token_gen_min
1194, // token_gen_max
60, // token_age
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // address
"tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt", // counterparty
"opPdGCS8cgW5j1id7WH485NuwjGnD4rVsJTaTZo4ftaT9jatFKJ" // op
]
]
List balance updates on all sub-accounts and different categories. Our categories go beyond on-chain types and include baking, denunciations, vesting contracts and the invoicing feature of protocol upgrades.
HTTP Request
GET https://api.tzstats.com/tables/flow?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
height int64 |
Block height at which this flow was created. |
cycle int64 |
Cycle at which this flow was created. |
time datetime |
Block time at which this flow was created. |
op_n int64 |
Related operation position in block. |
op_l int64 |
Tezos RPC operation list (0..3). |
op_p int64 |
Tezos RPC operation list position. |
op_c int64 |
Related bulk operation list position. |
op_i int64 |
Related internal operation list position. |
account_id uint64 |
Unique row_id of the account this flow relates to. |
counterparty_id uint64 |
Unique row_id of the counterparty that initiated/received the flow. |
address_type enum |
Account address type ed25519 (tz1), secp256k1 (tz2), p256 (tz3), contract (KT1) or blinded (btz1). |
category enum |
Flow category (i.e. sub-account) rewards , deposits , fees , balance , delegation . |
operation enum |
Operation creating this flow activation , denunciation , transaction , origination , delegation , reveal , endorsement , baking , noncerevelation , internal , vest , pour , invoice , airdrop . |
amount_in money |
Incoming amount in tz. |
amount_out money |
Outgoing amount in tz. |
is_fee bool |
Flag indicating this flow is a fee payment. |
is_burned bool |
Flag indicating this flow burns coins. |
is_frozen bool |
Flag indicating this flow goes towards a freezer sub-account. |
is_unfrozen bool |
Flag indicating this flow comes from a freezer sub-account. |
is_shielded bool |
Flag indicating this flow shielded coins in Sapling. |
is_unshielded bool |
Flag indicating this flow unshielded coins from Sapling. |
token_gen_min int64 |
Minimum generation number of tokens moved. |
token_gen_max int64 |
Maximum generation number of tokens moved. |
token_age float |
Age of tokens moved in days. |
address hash |
Address of the related account. |
counterparty hash |
Address of the counterparty of this flow. |
Income Table
Example request.
curl "https://api.tzstats.com/tables/income?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m&cycle=150"
Example response (comments added for explanation).
[
[
64698, // row_id
150, // cycle
278469, // account_id
3576, // rolls
3183854.077395, // balance
25426700.898205, // delegated
4, // n_delegations
199, // n_baking_rights
6507, // n_endorsing_rights
-292.000000, // luck
98.230000, // luck_percent
99.87, // performance_percent
100.00, // contribution_percent
201, // n_blocks_baked
0, // n_blocks_lost
2, // n_blocks_stolen
6507, // n_slots_endorsed
0, // n_slots_missed
15, // n_seeds_revealed
16198.000000, // expected_income
518336.000000, // expected_bonds
16176.875000, // total_income
519360.000000, // total_bonds
3216.000000, // baking_income
12959.000000, // endorsing_income
0.000000, // double_baking_income
0.000000, // double_endorsing_income
1.875000, // seed_income
1.680381, // fees_income
0.000000, // missed_baking_income
0.000000, // missed_endorsing_income
32.000000, // stolen_baking_income
0.000000, // total_lost
0.000000, // lost_accusation_fees
0.000000, // lost_accusation_rewards
0.000000, // lost_accusation_deposits
0.000000, // lost_revelation_fees
0.000000, // lost_revelation_rewards
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // address
1568887343000, // start_time
1569136305000 // end_time
]
]
List detailed baker income and income statistics. This table is extended for all active bakers at each cycle and updated at every block until a cycle is complete. That way, rows for open cycles will always contain live data up to the most recent block in the chain.
HTTP Request
GET https://api.tzstats.com/tables/income?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
cycle int64 |
Cycle this income relates to. |
account_id uint64 |
Unique row_id of the baker account this income relates to. |
rolls int64 |
Number of rolls (at snapshot block). |
balance money |
A baker’s own balance, composed of spendable balance and frozen deposits plus frozen fees (at snapshot block). Note that frozen rewards do not contribute towards rolls, hence they are not part of balance here. |
delegated money |
Delegated balance (at snapshot block). |
n_delegations int64 |
Count of incoming non-zero delegations (at snapshot block). |
n_baking_rights int64 |
Count of baking rights in this cycle. |
n_endorsing_rights int64 |
Count of endorsing rights in this cycle. |
luck money |
Absolute luck in coins, i.e. the amount of extra coins that can be earned because randomization allocated more rights than the fair share of rolls. |
luck_percent float |
Relation between actual random rights allocated vs. ideal rights gainable by rolls. Neutral luck is 100%, lower values indicated less rights than fair share, higher values indicate more rights. |
performance_percent float |
Effectiveness of a baker in generating expected rewards. Optimal performance is 100%. The value is lower when blocks or endorsements are missed, low value blocks/endorsements are published or the baker is slashed and higher when extra income was generated from stolen blocks or denunciations. NOTE: This value is not ratio scale nor interval scale. CANNOT be used as benchmark between bakers. |
contribution_percent float |
Effectiveness of a baker in utilizing all rights assigned and contribute to consensus. Optimal contribution is 100%. The value is lower when blocks or endorsements are missed and higher when blocks are stolen. NOTE: This value is ratio scale. It can be used as benchmark for baker availability or participation in consensus. It is strongly correlated to generated income, but does not capture low priority blocks, endorsements or slashing. |
n_blocks_baked int64 |
Number of blocks baked in this cycle. |
n_blocks_lost int64 |
Number of blocks lost in this cycle. |
n_blocks_stolen int64 |
Number of blocks stolen in this cycle. |
n_slots_endorsed int64 |
Number of slots endorsed in this cycle. |
n_slots_missed int64 |
Number of endorsement slots missed in this cycle. |
n_seeds_revealed int64 |
Number of seed nonces revealed in this cycle. |
expected_income money |
Total income expected based on endorsing and priority 0 baking rights. |
expected_bonds money |
Total expected deposits based on endorsing and priority 0 baking rights. |
total_income money |
Total sum of all income (note: due to losses, the actual true income may be smaller which is not reflected by this field alone). |
total_bonds money |
Actual deposits (note: due to losses, the actual bonds that will later be unfrozen may be smaller). |
baking_income money |
Total income from baking blocks. |
endorsing_income money |
Total income from endorsing blocks. |
double_baking_income money |
Total income from denouncing double baking. |
double_endorsing_income money |
Total income from denouncing double endorsing. |
seed_income money |
Total income from publishing seed nonces. |
fees_income money |
Total income from fees. |
missed_baking_income money |
Missed income from lost blocks. |
missed_endorsing_income money |
Missed income due to missed endorsements. |
stolen_baking_income money |
Extra income from stolen blocks. |
total_lost money |
Total lost income due to denunciations or unpublished seed nonces. NOTE: This does not automatically reduce total_income above. |
lost_accusation_fees money |
Lost fees due to a denunciation. |
lost_accusation_rewards money |
Lost rewards due to a denunciation. |
lost_accusation_deposits money |
Lost income due to a denunciation. |
lost_revelation_fees money |
Lost fees due to an unpublished seed nonce. |
lost_revelation_rewards money |
Lost block rewards due to an unpublished seed nonce. |
address hash |
Account address base58check encoded. |
start_time datetime |
Income cycle start time. |
end_time datetime |
Income cycle end time. |
Operation Table
Example request.
curl "https://api.tzstats.com/tables/op?time.gte=today&limit=1"
Example response (comments added for explanation).
[
[
16848289, // row_id
1573516812000, // time
689942, // height
168, // cycle
"opGz2Sg1QiXchJMyz9v1rV9VN7mQadmkL81KVwteANQWZpgV5ew", // hash
0, // counter
0, // op_n
0, // op_l
0, // op_p
0, // op_c
0, // op_i
"endorsement", // type
"applied", // status
1, // is_success
0, // is_contract
0, // gas_limit
0, // gas_used
0.000, // gas_price
0, // storage_limit
0, // storage_size
0, // storage_paid
0.000000, // volume
0.000000, // fee
2.000000, // reward
64.000000, // deposit
0.000000, // burned
18957, // sender_id
0, // receiver_id
0, // creator_id
0, // delegate_id
0, // is_internal
1, // has_data
"128", // data
null, // parameters
null, // storage
null, // big_map_diff
null, // errors
0, // days_destroyed
689941, // branch_height
1, // branch_depth
0, // is_implicit
0, // entrypoint_id
0, // is_orphan
0, // is_batch
0, // is_sapling
"tz1Z2jXfEXL7dXhs6bsLmyLFLfmAkXBzA9WE", // sender
null, // receiver
null, // creator
null // delegate
]
]
List detailed information about operations. Note that Tezos supports batch operations and internal operations created by smart contract calls in response to a transaction. On both types multiple ops share the same hash.
HTTP Request
GET https://api.tzstats.com/tables/op?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
time datetime |
Block time at which the operation was included on-chain. |
height int64 |
Block height. |
cycle int64 |
Cycle in which the operation was included on-chain. |
hash hash |
Operation hash. |
counter int64 |
Unique sender account ‘nonce’ value. |
op_n int64 |
Operation position in block. |
op_c int64 |
Bulk operation list position. |
op_i int64 |
Internal operation list position. |
op_l int64 |
Tezos RPC operation list (0..3). |
op_p int64 |
Tezos RPC operation list position. |
type enum |
Operation type, one of activate_account , double_baking_evidence , double_endorsement_evidence , seed_nonce_revelation , transaction , origination , delegation , reveal , endorsement , proposals , ballot or implicit event type bake , seed_slash , unfreeze , airdrop , invoice . |
status enum |
Operation execution status applied , failed , backtracked , skipped . |
is_success int64 |
Flag indicating operation was successfully applied. |
is_contract bool |
Flag indicating smart-contract calls. |
gas_limit int64 |
Caller-defined gas limit. |
gas_used int64 |
Gas used by the operation. |
gas_price float |
Effective price per gas unit in mutez. |
storage_limit int64 |
Caller-defined storage limit. |
storage_size int64 |
Actual storage size allocated. |
storage_paid int64 |
Part of the storage the operation paid for. |
volume money |
Amount of tokens transferred in tz. |
fee money |
Fees paid in tz. |
reward money |
Rewards earned in tz. |
deposit money |
Amount of deposited tokens in tz. |
burned money |
Amount of burned tokens in tz. |
sender_id uint64 |
Unique row id of the operation sender account. |
receiver_id uint64 |
Unique row id of the transaction receiver, may be zero. |
manager_id uint64 |
Unique row id of the new manager account, may be zero. |
delegate_id uint64 |
Unique row id of the new delegate account, may be zero. |
is_internal bool |
Flag indicating if this operation was sent be a smart contract. |
has_data bool |
Flag indicating if extra data or parameters are present. |
data bytes |
Extra operation-specific data, see decoding operation data. |
parameters bytes |
Call parameters as hex-encoded binary data serialized according to Micheline serialization for protocol v005 Babylon. |
storage bytes |
Updated contract storage as hex-encoded binary data serialized according to Micheline serialization for protocol v005 Babylon, contract-only. |
big_map_diff bytes |
Inserted, updated or deleted bigmap entries as hex-encoded binary data serialized according to Micheline serialization for protocol v005 Babylon, contract-only. |
errors bytes |
When failed, contains details about the reason as escaped JSON string. |
days_destroyed float |
Token days destroyed by this operation (tokens transferred * token idle time ). |
branch_height int64 |
Height of the branch block this op refers to. |
branch_depth int64 |
Count of blocks between branch block and block including this op. |
is_implicit bool |
Flag indicating implicit on-chain events, ie. state changes that don’t have an operation hash such as bake , unfreeze , seed_slash , airdrop and invoice . |
entrypoint_id int64 |
Serial id of the called entrypoint, only relevant if the operation was a transaction, the receiver is a smart contract and call parameters are present. |
is_orphan bool |
Flag indication whether this op was included in a block that was orphaned. |
is_batch bool |
Flag indicating if this operation is part of a batch operation list. |
is_sapling bool |
Flag indicating if this transaction interacted with a Sapling account. |
sender hash |
Address of the operation sender, always set. |
receiver hash |
Address of the receiver of a transaction, may be empty. |
creator hash |
Address of the original source of a contract call, may be empty. |
delegate hash |
Address of the new delegate account, may be empty. |
Proposal Table
Example request.
curl "https://api.tzstats.com/tables/proposal"
Example response (comments added for explanation).
[
[
5, // row_id
"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU", // hash
547386, // height
1564738976000, // time
38263, // source_id
12880576, // op_id
13, // election_id
15, // voting_period
66302, // rolls
304, // voters
"tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8", // source
"ooDAtGzFBeRUJcEK3QRBHU3kzk31CAp2RARYE3kmU3qsrvgs8JN" // op
]
]
List full details about every submitted proposal
HTTP Request
GET https://api.tzstats.com/tables/proposal?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
hash hash |
Protocol hash. |
height int64 |
Proposal operation block height. |
time datetime |
Proposal operation block time. |
source_id uint64 |
Unique row_id of the proposal sender account. |
op_id uint64 |
Unique row_id of the proposal operation. |
election_id uint64 |
Unique row_id of the election this proposal was submitted in. |
voting_period int64 |
On-chain sequence number of the voting period this proposal was submitted in. |
rolls int64 |
Number of rolls that voted for this proposal in the proposal period. |
voters int64 |
Number of voters who voted for this proposal in the proposal period. |
source hash |
Address of the sender account, base58check encoded. |
op hash |
Hash of the proposal operation, base58check encoded. |
Rights Table
Example request.
curl "https://api.tzstats.com/tables/rights?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m&cycle=154&limit=1"
Example response (comments added for explanation).
[
[
60555268, // row_id
"baking", // type
630785, // height
154, // cycle
3, // priority
278469, // account_id
1, // is_used
0, // is_lost
0, // is_stolen
0, // is_missed
0, // is_seed_required
0, // is_seed_revealed
0, // is_bond_miss
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // address
1569885537000 // time
]
]
List detailed rights for baking (all priorities 0..63) and endorsing. This table is extended with future data from cycle n+5 at the start of a new cycle N. During a cycle, rights for each block are updated according to actual baker, priority and endorsers.
HTTP Request
GET https://api.tzstats.com/tables/rights?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
type enum |
Right type, either baking or endorsing . |
height int64 |
Block height this right relates to. |
cycle int64 |
Cycle this right relates to. |
priority int64 |
Baking priority of this right. |
account_id uint64 |
Unique row_id of the baker who owns this right. |
is_used bool |
Flag indicating a right was used as intended. |
is_lost bool |
Flag indicating a baking right was lost to another baker. This flag appears when a baker fails to produce a block at the designated priority and another baker bakes the block at higher priority. |
is_stolen bool |
Flag indicating a baking right was stolen from another baker. This flag appears on the right relating to the actual baking priority. |
is_missed bool |
Flag indicating an endorser missed endorsing a slot. |
is_seed_required bool |
Flag indicating a baker is required to publish a seed_nonce_revelation in the next cycle. |
is_seed_revealed bool |
Flag indicating whether the baker actually revealed the required seed nonce. |
is_bond_miss bool |
Flag indicating a miss was caused by low balance to pay for deposits. |
address hash |
Address of the baker who owns this right. |
time datetime |
Past or estimated future block time for this right. |
Snapshot Table
Example request.
curl "https://api.tzstats.com/tables/snapshot?address=tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m&cycle=150&is_selected=1&limit=1"
Example response (comments added for explanation).
[
[
25384634, // row_id
616960, // height
150, // cycle
1, // is_selected
1569042994000, // time
9, // index
3915, // rolls
278469, // account_id
278469, // delegate_id
1, // is_delegate
1, // is_active
3216395.662038, // balance
28104896.167331, // delegated
7, // n_delegations
361000, // since
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // address
"tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m", // delegate
1553123692000 // since_time
]
]
List network-wide staking status across all bakers and delegators at snapshot blocks. this table contains all snapshots regardless of them being later chosen as cycle snapshot or not.
HTTP Request
GET https://api.tzstats.com/tables/snaphsot?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
height int64 |
Block height of this snapshot. |
cycle int64 |
Cycle of this snapshot. |
is_selected bool |
Flag indicating this snapshot was randomly selected as cycle snapshot. |
time datetime |
Block time of this snapshot. |
index int64 |
Snapshot index in the cycle [0..15]. |
rolls int64 |
(baker only) Number of rolls owned by the delegate. |
account_id uint64 |
Unique row_id of the account this snapshot relates to. |
delegate_id uint64 |
Unique row_id of the baker this account delegates to. |
is_delegate bool |
Flag indicating the current account is a baker. |
is_active bool |
Flag indicating the current account is an active baker. |
balance money |
Account staking balance (for bakers) or spendable balance (for delegators). |
delegated money |
(baker-only) Incoming delegated amount in tz. |
n_delegations int64 |
(baker-only) Incoming number of non-zero delegations. |
since int64 |
(delegator-only) Block height at which this delegation was created. |
address hash |
Account address. |
delegate hash |
Account delegate address. |
since_time datetime |
(delegator-only) Timestamp when this delegation was created. |
Supply Table
Example request.
curl "https://api.tzstats.com/tables/supply?time.gte=today&limit=1"
Example response (comments added for explanation).
[
[
1342246, // row_id
1342245, // height
327, // cycle
1613174407000, // time
866116758.904542, // total
576334364.096960, // activated
35120514.313220, // unclaimed
46582751.428168, // vested
106280968.174352, // unvested
759835790.730190, // circulating
533295452.655376, // delegated
684826946.710113, // staking
0.000000, // shielded
531009506.095934, // active_delegated
681028249.309738, // active_staking
2285946.559442, // inactive_delegated
3798697.400375, // inactive_staking
102153556.968822, // minted
32054769.288139, // minted_baking
70092988.673362, // minted_endorsing
5199.000000, // minted_seeding
600.007321, // minted_airdrop
355396.076980, // burned
132029.815883, // burned_double_baking
31838.219485, // burned_double_endorse
9210.716000, // burned_origination
176835.688250, // burned_implicit
5481.637362, // burned_seed_miss
60264181.814994, // frozen
58508544.000000, // frozen_deposits
1754196.047913, // frozen_rewards
1441.767081 // frozen_fees
]
]
List running supply totals at each block.
HTTP Request
GET https://api.tzstats.com/tables/supply?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
height int64 |
Block height the current row refers to. |
cycle int64 |
Cycle the current row refers to. |
time int64 |
Block time the current row refers to. |
total float64 |
Total supply, i.e. all coins in existence. |
activated money |
Activated fundraiser supply. |
unclaimed money |
Unclaimed fundraiser supply. |
vested money |
Vested genesis supply, i.e. spendable supply owned by vesting contracts. |
unvested money |
Unvested genesis supply, i.e. supply that is still locked in vesting contracts. |
circulating money |
Circulating supply, i.e. all immediately spendable supply (anything but unvested coins). |
delegated money |
Delegated supply, i.e. all spendable supply owned by delegators. |
staking money |
Staking supply, i.e. delegated supply and supply owned by bakers in form of spendable balances, frozen deposits and frozen fees. Frozen rewards are explicitly excluded because they can be slashed. |
shielded money |
Shielded supply held in Sapling contracts. |
active_delegated money |
Portion of delegated supply that is delegated to active delegates. |
active_staking money |
Portion of staking supply available to active delegates and used for securing consensus. |
inactive_delegated money |
Portion of delegated supply that is delegated to inactive delegates. |
inactive_staking money |
Portion of staking supply on inactive delegates that is not used for securing consensus. |
minted money |
Total issued supply in the form of block rewards. |
minted_baking money |
Issued supply as rewards for block baking. |
minted_endorsing money |
Issued supply as rewards for block endorsement. |
minted_seeding money |
Issued supply as rewards for seed nonce revelations. |
minted_airdrop money |
Issued supply as rewards for developers and protocol-upgrade airdrops (i.e. in Babylon). |
burned money |
Total burned supply. |
burned_double_baking money |
Total supply burned due to double baking. |
burned_double_endorse money |
Total supply burned due to double endorsement. |
burned_origination money |
Total supply burned due to contract originations. |
burned_implicit money |
Total supply burned due to implicit account creation. |
burned_seed_miss money |
Total supply burned due to implicit account creation. |
frozen money |
Currently frozen supply. |
frozen_deposits money |
Currently frozen bonds. |
frozen_rewards money |
Currently frozen rewards. |
frozen_fees money |
Currently frozen fees. |
Vote Table
Example request.
curl "https://api.tzstats.com/tables/vote?voting_period=16"
Example response (comments added for explanation).
[
[
18, // row_id
13, // election_id
5, // proposal_id
16, // voting_period
"testing_vote", // voting_period_kind
1565333282000, // period_start_time
1565333282000, // period_end_time
557056, // period_start_height
589823, // period_end_height
70585, // eligible_rolls
464, // eligible_voters
7291, // quorum_pct
51463, // quorum_rolls
57818, // turnout_rolls
179, // turnout_voters
8191, // turnout_pct
0, // turnout_ema
37144, // yay_rolls
171, // yay_voters
0, // nay_rolls
0, // nay_voters
20674, // pass_rolls
8, // pass_voters
0, // is_open
0, // is_failed
0, // is_draw
0, // no_proposal
0, // no_quorum
0, // no_majority
"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU" // proposal
]
]
List full details about every on-chain voting period.
HTTP Request
GET https://api.tzstats.com/tables/vote?args
HTTP Response
Field | Description |
---|---|
row_id uint64 |
Unique row identifier. |
election_id uint64 |
Unique row_id of the election this proposal was submitted in. |
proposal_id uint64 |
Unique row_id of the proposal that is voted for (or the winning proposal, if any, from the proposal period). |
voting_period int64 |
On-chain sequence number of the voting period. |
voting_period_kind enum |
Type of the voting period proposal , testing_vote , testing , promotion_vote . |
period_start_time datetime |
Block time of vote start block. |
period_end_time datetime |
Block time of vote end block. |
period_start_height int64 |
Block height of vote start block. |
period_end_height int64 |
Block height of vote end block. |
eligible_rolls int64 |
Number of eligible rolls for this vote. |
eligible_voters int64 |
Number of eligible voters for this vote. |
quorum_pct int64 |
Required quorum for this vote in percent. |
quorum_rolls int64 |
Required quorum for this vote in rolls. |
turnout_rolls int64 |
Actual vote participation in rolls. |
turnout_voters int64 |
Actual vote participation in voters. |
turnout_pct int64 |
Actual vote participation in percent. |
turnout_ema int64 |
Actual vote participation as moving average. |
yay_rolls int64 |
Count of yay voting rolls. |
yay_voters int64 |
Count of yay voting voters. |
nay_rolls int64 |
Count of nay voting rolls. |
nay_voters int64 |
Count of nay voting voters. |
pass_rolls int64 |
Count of pass voting rolls. |
pass_voters int64 |
Count of pass voting voters. |
is_open bool |
Flag indicating the vote is in progress. |
is_failed bool |
Flag indicating the vote has failed to select or activate a new protocol. |
is_draw bool |
Flag indication the reason for failure was a draw between two proposals in the proposal period. |
no_proposal bool |
Flag indication the reason for failure was no submitted proposal in the proposal period. |
no_quorum bool |
Flag indication the reason for failure was participation below the required quorum. |
no_majority bool |
Flag indication the reason for failure was acceptance below the required supermajority. |
proposal int64 |
Hash of the proposal that is voted on, if any. |
Time-Series Endpoints
Generic Time-Series Query
https://api.tzstats.com/series/{table_code}.{format}?{args}
The time-series API is an abstraction over tables which allows for server-side aggregation of multiple result rows over time. Time-series are meant to be displayed as graphs with time on the x-axis and some aggregate value on the y-axis. Since the underlying data is still in tabular form all table filters work on time-series as well.
Note that this time-series API does not fill gaps. That means when the underlying table contains no data for a particular time interval, the corresponding time-series row will be missing. Clients should be prepared for this case and fill gaps if required.
Intervals between timestamps are equally spaced and can be controlled by the collapse
query parameter, i.e. 1d
means each interval contains 24 hours of aggregated data. Time-series data can contain fields of all supported numeric data types (e.g. no strings or binary data). The aggregation function is fixed by the semantics of the data type. This may either be a sum, a count, first, last, min, max or mean value.
On the free API tier historic access is restricted to 90 days.
List of supported time-series
Endpoint | Time-Series Content |
---|---|
GET /series/block |
aggregated block data |
GET /series/flow |
aggregated balances, freezer and delegation flows |
GET /series/op |
aggregated operations data |
GET /series/chain |
running total counters for on-chain operations, accounts and rolls |
GET /series/supply |
running supply totals |
GET /series/{exchange}/{market}/ohlcv |
OHLCV candles |
Query Arguments
Time-series datasets support the following query parameters.
Argument | Description |
---|---|
columns optional |
Comma separated list of columns you like to fetch. Bulk array results will be ordered accordingly. Default is all defined columns for a series. |
collapse optional |
Aggregate numeric data over different sampling intervals. Supported values are 1m (default), 5m , 15m , 30m , 1h , 2h , 3h , 4h , 6h , 12h , 1d , 1w , 1M , 3M and 1y . |
order optional |
Return data in asc (ascending) or desc (descending) order. Default is asc . |
limit optional |
Maximum number of aggregated results returned. Limited to 50,000, default 500. |
start_date optional |
Start of the time range to query. See timestamps for syntax. |
end_date optional |
End of the time range to query. See timestamps for syntax. |
When only start or end date are provided, the other end of the range is deducted from collapse and limit. I.e. with collapse of 1d
and limit of 30
you’ll get 30 days of data after start_date or before end_date. Called without any optional parameters a query defaults to the most recent 500 minutes (end_date=now
, limit=500
and collapse=1m
).
Query Filters
Time-series support the same filters used on tables with the same filter expressions of form <column>.<operator>=<arg>
. Filters can be used on all table fields, including fields that are not part of the aggregated result such as addresses and type enums.
Block Series
Example request.
curl "https://api.tzstats.com/series/block.json?start_date=today&collapse=1d"
Example response.
[
[
1570060800000, // time
25002, // n_ops
6, // n_ops_failed
2, // n_ops_contract
674, // n_tx
2, // n_activation
0, // n_seed_nonce_revelation
0, // n_double_baking_evidence
0, // n_double_endorsement_evidence
24188, // n_endorsement
19, // n_delegation
95, // n_reveal
18, // n_origination
0, // n_proposal
6, // n_ballot
1489819.569887, // volume
2.223532, // fee
79822.000000, // reward
2565504.000000, // deposit
0.000000, // unfrozen_fees
0.000000, // unfrozen_rewards
0.000000, // unfrozen_deposits
8522.749680, // activated_supply
42.148000, // burned_supply
152, // n_new_accounts
134, // n_new_implicit
18, // n_new_managed
0, // n_new_contracts
46, // n_cleared_accounts
164, // n_funded_accounts
8167612, // gas_used
214, // storage_size
17867256.383035008 // days_destroyed
1440, // count
]
]
Lists aggregate data about blocks. Filters are the same as on the block table, but response fields are limited to numeric data that can be aggregated over time. Aggregation function for all fields is sum.
HTTP Request
GET https://api.tzstats.com/series/block?args
HTTP Response
Field | Description |
---|---|
time datetime |
Timestamp, start of interval. |
n_ops int |
Count of all operations. |
n_ops_failed int |
Count of failed operations. |
n_ops_contract int |
Count of smart-contract operations. |
n_tx int |
Count of transaction operations. |
n_activation int |
Count of activate_account operations. |
n_seed_nonce_revelation int |
Count of seed_nonce_revelation operations. |
n_double_baking_evidence int |
Count of double_baking_evidence operations. |
n_double_endorsement_evidence int |
Count of double_endorsement_evidence operations. |
n_endorsement int |
Count of endorsement operations. |
n_delegation int |
Count of delegation operations. |
n_reveal int |
Count of reveal operations. |
n_origination int |
Count of origination operations. |
n_proposal int |
Count of proposals operations. |
n_ballot int |
Count of ballot operations. |
volume int |
Count of amount of tokens moved between accounts. |
fee float |
Total fee paid (and frozen) by all operations. |
reward float |
Reward earned (and frozen) by baker. |
deposit float |
Deposit frozen by baker. |
unfrozen_fees float |
Total unfrozen fees (at end of a cycle). |
unfrozen_rewards float |
Total unfrozen rewards (at end of a cycle). |
unfrozen_deposits float |
Total unfrozen deposits (at end of a cycle). |
activated_supply float |
Total amount of commitments activated in tz. |
burned_supply float |
Total amount of tokens burned by operations in tz. |
n_new_accounts int |
Count of new accounts created regardless of type. |
n_new_implicit int |
Count of created implicit accounts (tz1/2/3). |
n_new_managed int |
Count of created managed accounts (KT1 without code or manager.tz script). |
n_new_contracts int |
Count of created smart contracts (KT1 with code). |
n_cleared_accounts int |
Count of accounts that were emptied (final balance = 0). |
n_funded_accounts int |
Count of accounts that were funded by operations (this includes all new accounts plus previously cleared accounts that were funded again). |
gas_used int |
Total gas consumed by operations. |
storage_size int |
Total sum of new storage allocated by operations. |
days_destroyed float |
Token days destroyed. |
count int |
Number of aggregated rows for this time bucket. |
Flow Series
Example request (network-wide re-delegation flows).
curl "https://api.tzstats.com/series/flow?start_date=today&collapse=1d&category=delegation"
Example response.
[
[
1570060800000, // time
200650.535155, // amount_in
246036.709877 // amount_out
12, // count
]
]
Lists aggregate data about flows. Filters are the same as on the flow table, but response fields are limited to numeric data that can be aggregated over time. Aggregation function for all fields is sum.
An interesting feature of flow series is that you can reconstruct the entire balance and delegation history of an account. You can either start at account creation time assuming zero balances or start at the current account state and work your way backwards through flows.
HTTP Request
GET https://api.tzstats.com/series/flow?args
HTTP Response
Field | Description |
---|---|
time datetime |
Timestamp, start of interval. |
amount_in float |
Incoming amount during interval in tz. |
amount_out float |
Outgoing amount during interval in tz. |
count int |
Number of aggregated rows for this time bucket. |
Operation Series
Example request.
curl "https://api.tzstats.com/series/op?start_date=today&collapse=1d"
Example response.
[
[
1570060800000, // time
8187812, // gas_used
214, // storage_size
0, // storage_paid
1493221.154887, // volume
2.228532, // fee
63790.000000, // reward
2052480.000000, // deposit
42.148000, // burned
17867317.80054702 // days_destroyed
2000, // count
]
]
Lists aggregate data about operations. Filters are the same as on the operation table, but response fields are limited to numeric data that can be aggregated over time. Aggregation function for all fields is sum.
HTTP Request
GET https://api.tzstats.com/series/op?args
HTTP Response
Field | Description |
---|---|
time datetime |
Timestamp, start of interval. |
gas_used int |
Total gas used by all operations. |
storage_size int |
Total storage size allocated by all operations. |
storage_paid int |
Total storage paid by all operations. |
volume float |
Total amount of tokens transferred by all operations in tz. |
fee float |
Fees paid by all operation in tz. |
reward float |
Rewards earned in by all operation tz. |
deposit float |
Amount of deposited tokens by all operation in tz. |
burned float |
Amount of burned tokens by all operation in tz. |
days_destroyed float |
Total token days destroyed by all operation. |
count int |
Number of aggregated rows for this time bucket. |
Chain Series
Example request.
curl "https://api.tzstats.com/series/chain?start_date=today&collapse=1d"
Example response.
[
[
815464, // height
199, // cycle
1581160828000, // time
425778, // total_accounts
398643, // total_implicit
26819, // total_managed
316, // total_contracts
20554157, // total_ops
104074, // total_contract_ops
22179, // total_activations
25277, // total_seed_nonce_revelations
17393631, // total_endorsements
131, // total_double_baking_evidences
24, // total_double_endorsement_evidences
54288, // total_delegations
272080, // total_reveals
29052, // total_originations
2755973, // total_transactions
494, // total_proposals
1036, // total_ballots
122042155, // total_storage_bytes
470269, // total_paid_bytes
0, // total_used_bytes
0, // total_orphans
387718, // funded_accounts
9346, // unclaimed_accounts
29352, // total_delegators
28005, // active_delegators
1347, // inactive_delegators
4031, // total_delegates
461, // active_delegates
3570, // inactive_delegates
8, // zero_delegates
138, // self_delegates
68, // single_delegates
255, // multi_delegates
81005, // rolls
433 // roll_owners
1, // count
]
]
Lists running totals and counters at each block. Collapse selects data from the first block in a time window.
HTTP Request
GET https://api.tzstats.com/series/op?args
HTTP Response
Field | Description |
---|---|
height int64 |
block height |
cycle int64 |
block cycle |
time int64 |
block creation time |
total_accounts int64 |
total number of accounts (all types, all states) |
total_implicit int64 |
total number of implicit accounts (tz1/2/3) |
total_managed int64 |
total number of managed delegation contracts (KT1, formerly without code) |
total_contracts int64 |
total number of deployed smart contracts (KT1 with code) |
total_ops int64 |
total number of on-chain operations (external and internal, but not implicit events) |
total_contract_ops int64 |
total number of on-chain calls to KT1 contracts |
total_activations int64 |
total number of on-chain fundraiser account activations |
total_seed_nonce_revelations int64 |
total number of on-chain seed nonce revelations |
total_endorsements int64 |
total number of on-chain endorsement operations (not slots) |
total_double_baking_evidences int64 |
total number of on-chain double-baking denunciations |
total_double_endorsement_evidences int64 |
total number of on-chain double-endorsing denunciations |
total_delegations int64 |
total number of on-chain delegations (including delegation withdrawals) |
total_reveals int64 |
total number of on-chain pubkey revelations |
total_originations int64 |
total number of on-chain contract originations (contains pre-Babylon delegation contracts) |
total_transactions int64 |
total number of on-chain transactions (contains internal transactions) |
total_proposals int64 |
total number of on-chain voting proposals operations |
total_ballots int64 |
total number of on-chain voting ballots |
total_storage_bytes int64 |
total number of allocated storage in bytes |
total_paid_bytes int64 |
total number of paid bytes |
total_used_bytes int64 |
total number of used bytes (TODO: does not work as expected yet) |
total_orphans int64 |
total number of alternative blocks |
funded_accounts int64 |
current number of funded accounts (non-zero balance) |
unclaimed_accounts int64 |
current number of unclaimed fundraiser accounts |
total_delegators int64 |
current number on non-zero balance delegators |
active_delegators int64 |
current number of non-zero balance delegators delegating to active delegates |
inactive_delegators int64 |
current number of non-zero balance delegators delegating to inactive delegates |
total_delegates int64 |
current number of registered delegates (active and inactive) |
active_delegates int64 |
current number of active delegates |
inactive_delegates int64 |
current number of inactive delegates |
zero_delegates int64 |
current number of active delegates with zero staking balance |
self_delegates int64 |
current number of active delegates with no incoming delegation |
single_delegates int64 |
current number of active delegates with 1 incoming delegation |
multi_delegates int64 |
current number of active delegates with >1 incoming delegations (delegation services) |
rolls int64 |
current number of rolls |
roll_owners int64 |
current number of distinct active delegates with rolls |
count int |
Number of aggregated rows. This series does a selection, so count is always equal to 1. |
Supply Series
Example request.
curl "https://api.tzstats.com/series/supply?start_date=today&collapse=1d"
Example response.
[
[
815478, // height
199, // cycle
1581161668000, // time
825170161.728791, // total
548313102.872648, // activated
63141775.537532, // unclaimed
27582743.428170, // vested
125280976.174350, // unvested
699889185.554441, // circulating
516489777.211404, // delegated
660867550.008684, // staking
0, // shieled
514264193.700025, // active_delegated
649473768.198626, // active_staking
2225583.511379, // inactive_delegated
11393781.810058, // inactive_staking
61045504.551923, // minted
12446481.404808, // minted_baking
48595263.514794, // minted_endorsing
3159.625000, // minted_seeding
600.007321, // minted_airdrop
193940.835832, // burned
114197.267834, // burned_double_baking
31838.219485, // burned_double_endorse
7221.767000, // burned_origination
37584.857000, // burned_implicit
3098.724513, // burned_seed_miss
54639772.184175, // frozen
52997504.000000, // frozen_deposits
1641852.516645, // frozen_rewards
415.667530 // frozen_fees
1, // count
]
]
Lists running supply totals at each block. Collapse selects data from the first block in a time window.
HTTP Request
GET https://api.tzstats.com/series/supply?args
HTTP Response
Field | Description |
---|---|
height int64 |
block height |
cycle int64 |
block cycle |
time datetime |
block creation time |
total money |
total available supply (including unclaimed) |
activated money |
total activated fundraiser supply |
unclaimed money |
total non-activated fundraiser supply |
vested money |
total genesis vesting-contract supply that has already vested |
unvested money |
total genesis vesting-contract supply that has not vested yet |
circulating money |
current circulating supply (by unanimous consent this is total - unvested even though frozen supply cannot move next block but still counts against total network value) |
delegated money |
current delegated supply (balances of all delegators) |
staking money |
current staking supply (balances of delegators and all bakers even if inactive, see below) |
shielded money |
current shielded supply (balances held in Sapling contracts) |
active_delegated money |
current active delegated supply (balances of all delegators delegating to active bakers) |
active_staking money |
current active staking supply (balances of all active bakers and their delegators) |
inactive_delegated money |
current inactive delegated supply (balances of all delegators delegating to inactive bakers) |
inactive_staking money |
current inactive staking supply (balances of all inactive bakers and their delegators) |
minted money |
total supply minted so far |
minted_baking money |
total supply minted as baking rewards |
minted_endorsing money |
total supply minted as endorsing rewards |
minted_seeding money |
total supply minted as seed nonce revelation rewards |
minted_airdrop money |
total supply minted in airdrops |
burned money |
total supply burned so far |
burned_double_baking money |
total supply burned by double baking denunciations |
burned_double_endorse money |
total supply burned by double endorsing denunciations |
burned_origination money |
total supply burned by contract originations |
burned_implicit money |
total supply burned by implicit account allocations |
burned_seed_miss money |
total supply burned by seed nonce revelation misses |
frozen money |
current frozen supply |
frozen_deposits money |
current frozen deposits |
frozen_rewards money |
current frozen rewards |
frozen_fees money |
current frozen fees |
count int |
Number of aggregated rows. This series does a selection, so count is always equal to 1. |
OHLCV Series
Example request for the 24 most recent hourly candles.
curl "https://api.tzstats.com/series/kraken/XTZ_USD/ohlcv?start_date=now-24h&collapse=1h"
Example response.
[
[
1570032000000, // time
0.94000, // open
0.94460, // high
0.90890, // low
0.92180, // close
0.92183, // vwap
36, // n_trades
3, // n_buy
33, // n_sell
7878.17322, // vol_base
7262.35661, // vol_quote
162.09115, // vol_buy_base
150.18552, // vol_buy_quote
7716.08207, // vol_sell_base
7112.17109 // vol_sell_quote
],
// ...
]
List aggregated OHLCV market data.
HTTP Request
GET https://api.tzstats.com/series/{exchange}/{market}/ohlcv
HTTP Response
Field | Description |
---|---|
time datetime |
Timestamp, start of interval. |
open float |
Opening price. |
high float |
Highest price. |
low float |
Lowest price. |
close float |
Closing price. |
vwap float |
Volume weighted average price from smallest increment (1 min). |
n_trades int |
Count of trades in the time-frame. |
n_buy int |
Count of trades where the market maker was buyer. |
n_sell int |
Count of trades where the market maker was seller. |
vol_base float |
Total trading volume in base currency (i.e. always XTZ). |
vol_quote float |
Total trading volume in quote currency. |
vol_buy_base float |
Buy-side volume in base currency. |
vol_buy_quote float |
Buy-side volume in quote currency. |
vol_sell_base float |
Sell-side volume in base currency. |
vol_sell_quote float |
Sell-side volume in quote currency. |
Changelog
Recent changes and additions to the TzStats Data API.
2021-02-10
A big deal of behind-the-scenes performance improvements went into this release, so that we are able to deliver the snappy response times you’re used to. We’ve started to prune irrelevant historic data from rights
(unused bolck priorities) and snapshots
(non-selected baker and delegator balances) to make querying relevant data faster.
We also reworked our smart contract data model, stripping less useful fields available elsewhere and adding new fields like detected interface standard and used Michelson features. When contract code is patched by a protocol upgrade we now add an implicit migration operation and update the stored representation of contract code as well. The previous version of the contract code is still available, either as part of the origination or the most recent migration operation.
This release adds support for Edo, namely Michelson extensions tickets, comb pairs and lazy storage (currently still exposed as bigmap on the API) as well as simple Sapling support (traking total Sapling supply and flows). Please reach out to tzstats@blockwatch.cc if you need additional Sapling or ticket support.
We decided to not remove deprecated operation listing endpoints because many people still use them and we found a way to optimize their performance.
BREAKING CHANGES
- api/contract: simplified and extended contract data model
- api/contract: replaced
bigmap_ids
array (numeric only) withbigmaps
object (mapping name to bigmap id) - api/contract: renamed
/explorer/contract/{hash}/manager
to/explorer/contract/{hash}/creator
- api/block: removed
endorsers
list and replaced it with an optional more informative butrights
list (use new query argrights=1
) - api/account: renamed
/explorer/account/{hash}/managed
to/explorer/account/{hash}/contracts
- api/account: removed deprecated fields
is_delegatable
,is_spendable
andis_vesting
- api/account: renamed field
manager
tocreator
- api/op: renamed field
manager
tocreator
- api/op: branch info moved behind the
meta
flag
NEW FEATURES
- api/metadata: added structured metadata to accounts, available as optional embedded field
metadata
on all accounts, operations, contracts, and contract calls (use new query argmeta=1
) - api/metadata: account metadata is also available as list on
/explorer/metadata
and single objects on/explorer/metadata/{hash}
- api/contract: added new lists
interfaces
andfeatures
that signal whether a contract implements any well-known interface standard or uses a specific Michelson feature - api/block: added new
rights
list that details owner and status of baking and endorsing rights - api/bakers: added new endpoint
/explorer/bakers
with several filters to list all active public and non-public bakers - api/op: new implicit contract migration operations as event log about changes to deployed contracts on protocol upgrades
- api/protocols:: new endpoint
/explorer/protocols
to list all deployed protocols, - api/bigmap: support bigmap pair keys from comma separated url args
- etl support Edonet, Edo protocol, new Edo opcodes, comb pairs, tickets and lazy storage
- etl detect Sapling enabled accounts, flag them in contract
features
- etl/flow new
is_shielded
andis_unshielded
flags to indicate flows into and out of Sapling contracts - etl/op new
is_sapling
flag to indicate a transaction interacted with a Sapling contracts
FIXES
- etl/account: fix removing accounts on rollback
- api/bigmap: more bigmap value rendering fixes
DEPRECATION NOTICES
- api/explorer:
deployments
list in/explorer/tip
will be removed in a future version
2020-06-24
To handle the surge in volume we’re optimizing a few of the most heavily used API endpoints. Our aim is to improve user experience and stabilty for everybody.
The most important change is that we begin migrating operation listings on explorer endpoints from embedded arrays inside accounts/blocks to stand-alone arrays. Both flavors will be available in parallel for a while. For high-speed high-volume access, consider using the table API endpoints. Table access is much faster since data is streamed and requires less calls due to higher limits.
As we keep adding new fields to tables and time-series the default order of JSON bulk arrays may change over time. To ensure that our API always returns the field order you expect, use the columns
query argument. The order of columns you specify is exactly the order that’s returned.
DEPRECATION NOTICES
- api/account: listing operations with
/explorer/account/{hash}/ops
and the embeddedops
array will be removed in the next API release - api/block: listing operations with
/explorer/block/{hash}/ops
and the embeddedops
array will be removed in the next API release
BREAKING CHANGES
- api/block:
nonce
is now returned as hex string - api/cycle: renamed
active_{bakers|endorsers}
toworking_{bakers|endorsers}
, also note the change in meaning ofactive_bakers
as described below - api/account: renamed explorer and table field
flow_rank
tovolume_rank
- api/account: moved
call_stats
from account table to contract table - api/account: we’re now hiding unused baker fields from non-baker accounts
- api/account: changed
/explorer/account/{hash}/ballots
return value from an account object with embeddedballots
field to a ballots array
FIXES
- api/account: fixed traffic and volume rank sorting
- api/account: return origination only when no entrypoint filter is used
- api/account: fixed
since
off-by-one bug on contract call and account operation lists - api/account: fixed
until
param not limiting call/operation lists for recently active accounts - api/account: fixed duplicates in account operation list
- api/operation: fixed return data from bigmap copy and bigmap delete operations
- api/cache: fixed cache expiration time on account, contract, rights
- etl/income: don’t count unfrozen rewards into end-of-cycle snapshots
- etl/income: use max block reward for counting missed rewards on priority zero baker and max endorsement reward for missed endorsement slots
- etl/statistics: fixed active delegation counting for foundation bakers
- etl/statistics: fixed block volume counting for failed ops
- etl/account: fixed pubkey updates on reveal that caused some keys to be scrambled
- api/deployments: fixed protocol version lookup and deployment info
- etl/income: fixed
total_income
to include all fees and denunciation rewards
NEW FEATURES
- api/operation:
delegation
operations now havevolume
field set to the initial delegated balance - api/operation: new fields
is_batch
andbatch_volume
on first operation in an explorer batch list - api/operation: added new implicit activation and delegation operations from genesis bootstrap
- api/operation:
bake
andunfreeze
implicit operations now contain the baker as sender and receiver to allow listing bake/endorse/unfreeze ops with a single operation table call - api/operation: added implicit baker registrations in protocols v001 (due to a protocol bug) and v002 (at migration)
- api/series: new virtual column
count
that contains the number of aggregated entries per bucket - api/account: support query arguments
limit
,cursor
,order
on ballot lists - api/account: new explorer fields
avg_luck_64
,avg_performance_64
,avg_contribution_64
,baker_version
,delegate_until
anddelegate_until_time
- api/cycle: new explorer fields
snapshot_time
,active_bakers
andactive_delegators
for a total number of all registered bakers and funded delegators at cycle snapshot - api/account: new table fields
next_bake_height
,next_bake_priority
,next_bake_time
,next_endorse_height
,next_endorse_time
that will be set for active bakers - api/ballot: new table filter modes
ne
,in
,nin
forballot
- api/rights: new table filter modes
ne
,in
,nin
fortype
- api/rights: new flag
is_bond_miss
to differentiate loss events between low bonds and other failures - new explorer endpoints
/explorer/rank/balances
(rich list),/explorer/rank/traffic
(1D transaction counts),/explorer/rank/volume
(1D transaction volume) - new explorer endpoint
/explorer/election/:id/:stage/voters
to list all voters - new explorer endpoint
/explorer/election/:id/:stage/ballots
to list all ballots cast during a voting period - new explorer endpoint
/explorer/account/{hash}/operations
(replaces embeds on../ops
) - new explorer endpoint
/explorer/block/{hash}/operations
(replaces embeds on../ops
) - support
filename
argument for CSV downloads from tables and time-series
2020-02-24
FIXES
- etl/model: frozen deposits, rewards and fees were not correctly deducted from delegate balance and total frozen supply
- etl/model: fixed spelling of
denunciation
type in flow table - chain: use protocol constants for snapshot block calculations (was a fixed offset value before that only worked on mainnet)
- chain: tolerate arbitrary padding after binary address values in contract storage (when manually packed into type bytes inside a contract one can add an optional annotation which now gets stripped to obtain a valid address)
- etl/index: fix baker performance on zero rights to avoid edge case in 3rd party reputation algorithms that penalized bakers without rights, no income still yields 100% performance now
- micheline/entrypoint: fix detecting named Unit entrypoints
- etl/index: fix empty bigmap operation that deletes all keys and allocates a new bigmap, added
is_removed
bool field to explorer/bigmap endpoint - micheline/bigmap: refactor to support pairs as key type
- micheline/bigmap: render empty optional values, use inner type in keys when option annotation is missing
NEW FEATURES
- etl:
delegation
operation now stores previous delegate in formerly unusedreceiver
field - etl:
seed_nonce_revelation
operation now stores actual seed publisher in formerly unusedreceiver
field - etl: internal transaction operations keep original sender of an external transaction in formerly unused
manager
field - etl: added new operation types for implicit events
bake
,invoice
,airdrop
,unfreeze
,seed_slash
; op hashes for implicit operations are empty, values forop_n
are negative (-1 for block header, -2 for protocol upgrade events); available on explorer, table and series endpoints - api/block: block operation listing now supports
order
similar to accounts - api/op: explorer operation lists now support table-style filters on type, e.g. to filter for multiple types use
type.in=bake,endorsement
as query argument - api/op: explorer operation lists now support
prim
andunpack
query arguments to simplify working with contract calls - api/op: added new field
entrypoint_id
to operations which contains the sequence number (id) of the called entrypoint; filter by entrypoint on table endpoints is also supported - api/op: added new field
call
to embedded operationparameters
to identify the actual named entrypoint that was called, this is useful if parameters call the default or root entrypoint and specify the real one by branching - api/op:
unpack=1
now recursively unpacks all packed binary data - api/contract: added new field
iface_hash
(first 4 bytes of the SHA256 hash over binary encoded Michelson script parameters) - api/contract: added new field
call_stats
with per-entrypoint call statistics (an array containing running totals) - api/contract: added new fields
op_l
,op_p
andop_i
to reference the position of the contract’s origination operation in a block. - api/contract: contract calls now support
entrypoint
filters using entrypoint name, branch or id - etl/model: added cycle
start_time
andend_time
to baker income (estimated when start or end is in the future) - api/series: new time-series endpoints for
chain
andsupply
tables that will return the first value per collapse interval (ie. first value per hour or day) - flow table: added new fields
op
(hash),op_id
(uint64),op_n
,op_l
,op_p
,op_c
,op_i
(int) which contain metadata about the operation the flow relates to - operation table: added new fields
op_l
,op_p
containing Tezos RPC operation list positions, andis_implicit
for non-operation events as well asentrypoint_id
BREAKING CHANGES
- block: replaced fields
deposits
,fees
,rewards
(plural) which included total sums of all baking and endorsing activity in a block withdeposit
,fee
,reward
(singular form) to only cover baking activity - flow: replaced fields
origin_id
andorigin
withcounterparty_id
andcounterparty
; origin used to contain the source of a flow but was too restrictive since on-way only, now counterparty can hold either party (sender or receiver) who has caused or received a flow, on in-flows (amount_in > 0) the counterparty is the sender, on out-flows (amount_out > 0) counterparty it receiver - flow: JSON bulk array list positions shift because of new fields in the inner array
- operation: changed data for
denunciation
operations, now losses incured by the offender are kept inreward
,fee
, anddeposit
as negative values, reward for the accuser is stored involume
as positive value - operation: JSON bulk array list positions shift because of new fields in the inner array. Changed
op_n
to contain a unique per-block operation counter across all implicit and regular operations. - contract/script: JSON keys for entrypoint arguments now always follow the convention
<order>@<name>
, ie. they include an integer order number as first argument, followed by an optional@
symbol and an optional argument name extracted from type annotations. This way argument order is no longer lost when a name is defined. - bigmap/type: JSON keys for bigmap type arguments now always follow the convention
<order>@<name>@<container-type>
, ie. they include an integer order number as first argument, followed by an optional@
symbol, an optional name extracted from type annotations and in case the type is a container like list, map or set another@
and the container type. This way type argument order is no longer lost when a name is defined.
2020-01-06
- UPGRADES
- supports Carthage protocol PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb
- supports new Carthage reward constants for Emmy+ called
baking_reward_per_endorsement
andendorsement_reward
in the Tezos RPC - updated expected income based on new rewards formula
- NEW EXPLORER FEATURES
/explorer/config/{height}
now returns two additional float arraysblock_rewards_v6
andendorsement_rewards_v6
containing the new Carthage reward constants; the previous fieldsblock_reward
andendorsement_reward
remain unchanged and will contain the first elements from the corresponding v6 arrays- add network health estimation based on recent 128 blocks (priority, endorsements, reorgs)
- FIXES
- block operation list paging with offset/limit now properly counts internal and batch operations
- voting period start and end heights are no longer off by 1
- voting quorum, ema and eligible rolls calculations are corrected
- improved smart contract entrypoint detection so that annotated parent nodes in the parameter primitive tree are no longer shadowing valid entrypoints
- DEPRECATION NOTICES
2019-12-05
- FIXES
- account
is_revealed
is now correctly reset when account balance becomes zero (in this case a Tezos node will remove all account data including a revealed pubkey from storage) - eligible voting rolls are now taken after cycle start block is processed
- counting duplicate proposal votes has been corrected
- annualized supply calculation has been fixed to use 365 instead of 364 days
- fixed vote table
period_start_height
andperiod_end_height
field names - fixed empty fields in some CSV results
- numeric filters on tables now fully support range, in and not-in argument lists
- corrected
income.missed_baking_income
when prio 0 blocks are lost - corrected
supply.circulating
to contain all coins that can move next block (= total - unvested)
- account
- NEW EXPLORER FEATURES
- added config field
deployment
that contains a serial counter of protocol activations on the chain - changed config field
version
to show the protocol implementation version (ie. 4 for Athens, 5 for Babylon, etc) - added block field
successor
- added op fields
branch_id
,branch_height
,branch_depth
,branch
- extended op fields
paramaters
,storage
andbig_map_diff
to include unboxed types and values and made prim tree optional - added new contract endpoints
/explorer/contract/{addr}/calls
to list smart contract calls/explorer/contract/{addr}/manager
current manager account (originator in v005)/explorer/contract/{addr}/script
code, storage & parameter types/explorer/contract/{addr}/storage
current storage state
- added contract field
bigmap_ids
to list ids of bigmaps owned by this contract - added bigmap endpoints
/explorer/bigmap/{id}
bigmap metadata/explorer/bigmap/{id}/type
bigmap type definition/explorer/bigmap/{id}/keys
list bigmap keys/explorer/bigmap/{id}/values
list bigmap key/value pairs/explorer/bigmap/{id}/updates
list bigmap updates/explorer/bigmap/{id}/{key}
single bigmap value/explorer/bigmap/{id}/{key}/updates
list updates for a single bigmap value
- listing account ops supports
order
,block
andsince
query arguments
- added config field
- NEW TABLE FEATURES
- added op table fields
branch_id
,branch_height
,branch_depth
- added bigmap table
/tables/bigmap
to access raw bigmap updates - changed CSV timestamps to RFC3339 (from UNIX milliseconds)
- added op table fields
- DEPRECATION NOTICES
- removed deprecated income table fields
efficiency_percent
,slashed_income
andlost_baking_income
- contract field
ops
and endpoint/explorer/contract/{addr}/op
will be removed (use/explorer/account/{addr}/op
endpoint instead) - contract fields
delegate
,manager
,script
will be removed (new endpoints or related account)
- removed deprecated income table fields
2019-11-01
- DEPRECATION NOTICE: income field
efficiency_percent
will be removed with the next release - replaced income field
efficiency_percent
withperformance_percent
(value range[-Inf,+Inf]
) to avoid confusion with existing benchmarking metrics that define baker efficiency as percentage or rights utilized - added new income field
contribution_percent
to measure a baker’s contribution to consensus in terms of baking/endorsing rights utilized (value range[0,100]
, baking/endorsing misses will lower contribution, steals will increase it) - cycle
n_double_baking
andn_double_endorsement
count events instead of accusation operations now
2019-10-26
- renamed income table field
lost_baking_income
intomissed_baking_income
to align its name withmissed_endorsing_income
- renamed income table field
slashed_income
intototal_lost
because it includes not only income but also deposits that may be slashed - added new income fields
lost_accusation_fees
,lost_accusation_rewards
,lost_accusation_deposits
,lost_revelation_fees
,lost_revelation_rewards
to differentiate losses - added new supply field
burned_seed_miss
to capture supply burned by missed seed nonce revelations
2019-10-24
- add
n_endorsed_slots
to block table, series and explorer endpoint - support bigint in smart contract params, code, bigmaps and storage
2019-10-20
- changed some supply fields from
mined_*
tominted_*
- add new supply field
minted_airdrop
for invoices and protocol upgrade airdrops - support Babylon airdrop of 1 mutez to manager accounts