Explorer API
Use explorer API endpoints to access data in JSON object and list format. 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 on-chain object (e.g. the recent block or cycle) - a block
height
(a.k.a level in Tezos) - a sequence
number
for cycles and elections
Available Endpoints​
Endpoint (P = paginated, F = filtered) | Comment | |
---|---|---|
/explorer/status | indexer status | |
/explorer/config/{id} | blockchain config | |
/explorer/tip | blockchain tip info | |
/explorer/protocols | list of deployed protocols | |
/explorer/bakers | baker list | |
/explorer/bakers/{hash} | baker info | |
/explorer/bakers/{hash}/votes | P | baker proposals and ballots |
/explorer/bakers/{hash}/endorsements | P | baker endorsements |
/explorer/bakers/{hash}/delegations | P | baker delegations |
/explorer/bakers/{hash}/income/{cycle} | baker income for cycle | |
/explorer/bakers/{hash}/rights/{cycle} | baker rights for cycle | |
/explorer/bakers/{hash}/snapshot/{cycle} | baker snapshot for cycle | |
/explorer/block/{id} | block info | |
/explorer/block/{id}/operations | PF | list block ops |
/explorer/op/{hash} | operation info | |
/explorer/account/{hash} | account info | |
/explorer/account/{hash}/contracts | P | list deployed contracts |
/explorer/account/{hash}/operations | PF | list account operations |
/explorer/account/{hash}/ticket_events | PF | list account ticket events |
/explorer/account/{hash}/ticket_balances | PF | list account ticket balances |
/explorer/contract/{hash} | smart contract info | |
/explorer/contract/{hash}/calls | PF | list contract calls |
/explorer/contract/{hash}/script | contract script | |
/explorer/contract/{hash}/storage | current contract storage | |
/explorer/contract/{hash}/tickets | PF | list issued tickets |
/explorer/contract/{hash}/ticket_events | PF | list ticket events |
/explorer/contract/{hash}/ticket_balances | PF | list ticket balances |
/explorer/constant/{hash} | global constant | |
/explorer/bigmap/{id} | bigmap info | |
/explorer/bigmap/{id}/keys | P | list bigmap keys |
/explorer/bigmap/{id}/values | P | list bigmap key/value pairs |
/explorer/bigmap/{id}/{key} | read single bigmap value | |
/explorer/bigmap/{id}/updates | P | list bigmap updates |
/explorer/bigmap/{id}/updates/{key} | P | list bigmap key updates |
/explorer/cycle/{id} | cycle info | |
/explorer/election/{id} | election info | |
/explorer/election/{id}/{stage}/voters | P | list voters |
/explorer/election/{id}/{stage}/ballots | P | list ballots |
/metadata/{hash}[/{id}] | read account & token metadata | |
/metadata/schemas | list metadata schema names | |
/metadata/schemas/{schema} | read JSON schema definition | |
/markets | list known markets | |
/markets/tickers | list market tickers | |
/markets/{exchange} | read exchange status | |
/markets/{exchange}/{market} | read market status | |
/markets/{exchange}/{market}/ticker | read single market ticker |
Pagination and Sorting​
List endpoints support pagination (e.g. to list historic transactions, contract calls, voters, etc). Two pagination methods are supported:
cursor
+limit
is the preferred method, it uses therow_id
of the last result as argument to efficiently skips to the next available objectoffset
+limit
is similar, but less efficient, it takes the count of objects seen so far and skips them when retrieving more results (as the chain grows, using offset in combination with descending order may return duplicates; we therefore recommend using the cursor method)
Default value for limit is 20 results on explorer endpoints and 500 results on tables, maximum is 500 and 50,000. 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.
Indexer Status​
GET /explorer/status
Returns the current indexer status, useful to check if the indexer is in sync with the blockchain.
HTTP Response​
Field | Description |
---|---|
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. |
Example Request​
curl "https://api.tzpro.io/explorer/status"
import (
"context"
"github.com/trilitech/tzstats-go"
)
// use default Mainnet client
status, err := tzstats.DefaultClient.GetStatus(context.Background())
Example Response​
{
"mode": "sync",
"status": "synced",
"blocks": 626399,
"indexed": 626399,
"progress": 1
}
Returns the current indexer status, useful to check if the indexer is in sync with the blockchain.