Bitcoin 2 Block Explorer Real-time API Queries
Each API query URL starts with: https://www.bitc2.org/block-explorer/apiquery?q= followed by the command.
There is a rate limit so set your bot to fetch no faster than a human would.
So for example:
https://www.bitc2.org/block-explorer/apiquery?q=getinfo
Summary Queries
- getinfo - Summary of the current Bitcoin 2 blockchain data. Gets the number of blocks, difficulty, current money supply (Bitcoin 2s in circulation) and the portion of the zBTC2 supply. (The zBTC2 supply is included in the BTC2 supply).
- getsupply - Gets the current money supply. (Bitcoin 2s in circulation, zBTC2 included.)
- getsupplyinsatoshis - Gets the current money supply in satoshis. (Bitcoin 2 satoshis in circulation, zBTC2 included.)
- getblockcount - Gets the number of blocks. JSON result.
- getblockcountsimple - Gets the number of blocks. Returns an integer. Returns 0 if there's an error.
- getdifficulty - Gets the current difficulty.
Block Queries
- getblock&nr=X - Gets the block X. Where X is any block number, such as 50000. (Combines getblockhash&nr=X and getblock&hash=X commands into one command.)
- getblockhash&nr=X - Gets the block hash of block number X. Where X is any block number, such as 50000.
- getblockheader&hash=X - Gets the block header of the block X. Where X is any block's hash, such as 3bff63563cc0d2e7bd2e4307b5c4d9249a8e6aebf36a0e4ddb1fe97c953e048e.
- getblock&hash=X - Gets the block X. Where X is any block's hash, such as 3bff63563cc0d2e7bd2e4307b5c4d9249a8e6aebf36a0e4ddb1fe97c953e048e.
Transaction Queries
- gettransaction&hash=X - Gets the transaction X. Where X is any transaction's hash, such as b31144ab8e33052b34d6f15b37f46ffdc59e035f3bd9fe536f642d4c51703047.
- getrawtransaction&hash=X - Gets the raw, serialized transaction X. Where X is any transaction's hash, such as b31144ab8e33052b34d6f15b37f46ffdc59e035f3bd9fe536f642d4c51703047.