Bitcoin Tutorials - Herong's Tutorial Examples - v1.04, by Dr. Herong Yang
blockexplorer.com API - Get Block Data
This section describes how to get block data with blockexplorer.com API.
Bitcoin blockexplorer.com API offers two primary services to get Bitcoin block data:
Both services requires you to provide the block hash to identify the bock. If you don't know the block hash, you can get it use the "/api/block-index/[:height]" service.
You can try Bitcoin blockexplorer.com API to get Bitcoin block data with any Web browser. Here is what I did to get information of block # 500 on the Bitcoin test network:
GET https://testnet.blockexplorer.com/api/block-index/500 {"blockHash": "00000000a2424460c992803ed44cfe0c0333e91af04fde9a6a97b468bf1b5f70"} GET https://testnet.blockexplorer.com/api/rawblock /00000000a2424460c992803ed44cfe0c0333e91af04fde9a6a97b468bf1b5f70 {"rawblock":"01000000272ecd270665dc39e924838516da62f8588270f1e37812aab..."} GET https://testnet.blockexplorer.com/api/block /00000000a2424460c992803ed44cfe0c0333e91af04fde9a6a97b468bf1b5f70 {"hash":"00000000a2424460c992803ed44cfe0c0333e91af04fde9a6a97b468bf1b5f70", "size":1868,"height":500,"version":1,"merkleroot":"dd3f288510dd3b632940bd3f b1db162d3ff99b19ddb0c586cfa3ac9a76d42517","tx":["a647d0c4112b4727f3c856782f f6bbaf099be929b27214a8e0dfedee4383eb68","24b8a4c788b8c805b810438ddd99e569e1 84ff20f4394ac49a6d832e69f57242","c5ffd70c3bc4998465cef55ed6d5d831ab3a550406 423eb611117ed8ee41c278","4692772a73ea834c836915089acf97f2c790380a2b8fd32f82 729da72545d8c5","82d6d88081e3e0eb36730f7f3aedb17228142b9e00a6dbaab4b53b798d 0742c1","fc407d7a3b819daa5cf1ecc2c2a4b103c3782104d1425d170993bd534779a0da", "95ad3ffb2a9426d6f5f5b97a134d90153ae16c9375f74eb385f481cff2771d77"],"time": 1296746771,"nonce":2325411586,"bits":"1d00ffff","difficulty":1,"chainwork": "000000000000000000000000000000000000000000000000000001f501f501f5","confirm ations":1283001,"previousblockhash":"000000008cd4b1bdaa1278e3f1708258f862da 16858324e939dc650627cd2e27","nextblockhash":"00000000c7f50b6dfac8b8a59e11b7 e62f07fdef20597089b9c5d64ebfe6d682","reward":50,"isMainChain":true,"poolInf o":{}}
Below is a screenshot of Chrome running Bitcoin blockexplorer.com API:
Table of Contents
Bitcoin Transaction Data Structure
Introduction of blockexplorer.com API
►blockexplorer.com API - Get Block Data
blockexplorer.com API - Get Transaction Data