Spacemesh explorer backend designed to provide data for explorer-frontends
The explorer backend provides a public REST API that can be used to get data about a Spacemesh network. Follow these steps to use the API for a public Spacemesh network:
https://mainnet-explorer-api.spacemesh.network/
then the network-info data is available at https://mainnet-explorer-api.spacemesh.network/network-info
.curl https://mainnet-explorer-api.spacemesh.network/network-info
. pagesize
and page
params to get paginated results. The first page number is 1, so for example, to get the first 20 layers call: https://mainnet-explorer-api.spacemesh.network/layers?pagesize=20&page=1
and to get the next 20 layers use: https://mainnet-explorer-api.spacemesh.network/layers?pagesize=20&page=2
{"totalCount":1020,"pageCount":51,"perPage":20,"next":2,"hasNext":true,"current":1,"previous":1,"hasPrevious":false}}
Use this pagination data to figure out how many calls you need to make and which what params in order to get all the data.
The API is not properly documented yet. The best way to identity the supported API methods is via the api server source code.