Skip to main content
Version: 0.9.1

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/statusindexer status
/explorer/config/{id}blockchain config
/explorer/tipblockchain tip info
/explorer/protocolslist of deployed protocols
/explorer/bakers baker list
/explorer/bakers/{hash}baker info
/explorer/bakers/{hash}/votesPbaker proposals and ballots
/explorer/bakers/{hash}/endorsementsPbaker endorsements
/explorer/bakers/{hash}/delegations Pbaker 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}/operationsPFlist block ops
/explorer/op/{hash}operation info
/explorer/account/{hash}account info
/explorer/account/{hash}/contractsPlist deployed contracts
/explorer/account/{hash}/operationsPFlist account operations
/explorer/account/{hash}/ticket_eventsPFlist account ticket events
/explorer/account/{hash}/ticket_balancesPFlist account ticket balances
/explorer/contract/{hash}smart contract info
/explorer/contract/{hash}/callsPFlist contract calls
/explorer/contract/{hash}/scriptcontract script
/explorer/contract/{hash}/storagecurrent contract storage
/explorer/contract/{hash}/ticketsPFlist issued tickets
/explorer/contract/{hash}/ticket_eventsPFlist ticket events
/explorer/contract/{hash}/ticket_balancesPFlist ticket balances
/explorer/constant/{hash}global constant
/explorer/bigmap/{id}bigmap info
/explorer/bigmap/{id}/keysPlist bigmap keys
/explorer/bigmap/{id}/valuesPlist bigmap key/value pairs
/explorer/bigmap/{id}/{key}read single bigmap value
/explorer/bigmap/{id}/updatesPlist bigmap updates
/explorer/bigmap/{id}/updates/{key}Plist bigmap key updates
/explorer/cycle/{id}cycle info
/explorer/election/{id}election info
/explorer/election/{id}/{stage}/votersPlist voters
/explorer/election/{id}/{stage}/ballotsPlist ballots
/metadata/{hash}[/{id}]read account & token metadata
/metadata/schemaslist metadata schema names
/metadata/schemas/{schema}read JSON schema definition
/marketslist known markets
/markets/tickers list market tickers
/markets/{exchange}read exchange status
/markets/{exchange}/{market}read market status
/markets/{exchange}/{market}/tickerread 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 the row_id of the last result as argument to efficiently skips to the next available object
  • offset + 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​

FieldDescription
FieldDescription
mode enumChain crawling mode (sync = live monitoring).
status enumIndexer status (connecting, syncing, synced, failed).
blocks int64Most recent block height seen by the connected Tezos node.
indexed int64Most recent block height indexed.
progress floatPercentage 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.