RESTful API for unusual and uncommon blockchain queries.
python setup.py install
blocksapi
./deploy.sh v0.0.1b3
All API endpoints are prefixed by the version number. For instance, a call to
block would be /v1/block.
All calls are limited to 100 returned objects. You can paginate by using the
request object parameter page.
Query for groups of blocks.
{
'block_number': 1,
"start": 123,
"end": 443920,
"start_time": 1514592000,
"end_time": 1514851140,
"page": 1
}
block_number: A single block to retreivestart: The beginning of a range of block numbers to retreiveend: The end of a range of block numbers to retreivestart_time: The unix timestamp for the start of a range of blocks to retreiveend_time: The unix timestamp for the end of a range of blocks to retreivehas_transactions: Whether or not the block has transactionspage: The page number of results to retreive
{
"page": 1,
"results": [
{
"block_number": 1,
"block_timestamp": 1514592000,
"hash": "0x88e96d4537bea4d9c05d12549907b32561d3bf31f45aae734cdc119f13406cb6",
"miner": "0x05a56E2D52c817161883f50c441c3228CFe54d9f",
"nonce": 6024642674226568900,
"difficulty": 17171480576,
"gas_used": 0,
"gas_limit": 5000,
"size": 537
}
]
}
Query for transactions.
{
"hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
"block_number": 1,
"from_address": "0xA1E4380A3B1f749673E270229993eE55F35663b4",
"to_address": "0x5DF9B87991262F6BA471F09758CDE1c0FC1De734"
}
{
"page": 1,
"results": [
{
"hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
"block_number": 1,
"from_address": "0xA1E4380A3B1f749673E270229993eE55F35663b4",
"to_address": "0x5DF9B87991262F6BA471F09758CDE1c0FC1De734",
"value": 31337,
"gas_price": 50000000000000,
"gas_limit": 21000,
"nonce": 0,
"input": "0x"
}
]
}