How to access Blockchain remotely for statistics study?

1

1

I would like to write small paper supported by Blockchain stats. Could you tell me how to access blocks chain remotely via GUI to make a query ?

Blockchain's size is 159GB as of today, so download is heavy.

Ok, I can study block headers only to limit overheads.

Do you know how to download or access blockchain headers as mySQL database ?

How to access Blockchain remotely for statistics study ?

darius

Posted 2017-10-24T21:58:59.287

Reputation: 55

Ok, I can limit my interest to block headers only to create database.

https://blockchain.info/block-height/474044?format=json So all I need is block header from the above block. Any download link ? Studied blockchain json API but no support for block header only.

darius 2017-10-24T23:02:17.810

https://blockchain.info/block-height/491459 is the answer but output is not generated via API, so I need raw json block header output, not full webpage code includeddarius 2017-10-24T23:37:07.330

Answers

2

As you mention in your comments, blockchain.info can provide this information.

You can get a raw block in JSON format using the /rawblock/ links, for example: https://blockchain.info/rawblock/0000000000000000008d49f25f7dd5d3704575a348e030a1d2e5f396b3e80516

Then you can also get it as the hex-encoded raw block by adding ?format=hex to the url: https://blockchain.info/rawblock/0000000000000000008d49f25f7dd5d3704575a348e030a1d2e5f396b3e80516?format=hex

Hope that's what you are after :)

EDIT: Oh, just re-read your comment, you want just the headers? In that case you probably can't use blockchain.info, you could try BlockCyhper instead:

For example: https://api.blockcypher.com/v1/btc/main/blocks/294322

You can find more info about their API here: https://www.blockcypher.com/dev/bitcoin/#blockchain-api

MeshCollider

Posted 2017-10-24T21:58:59.287

Reputation: 8 735

thank you MeshCollider for your excellent answer. At first view block headers by blockcypher and by blockchain look the same but blockcypher sets nonce to "0" . I have no tools to verify if other data in the block header are reliable generate charts for my paper Just have a look: https://blockchain.info/block-height/491658 vs. https://api.blockcypher.com/v1/btc/main/blocks/491658 or https://api.blockcypher.com/v1/btc/main/blocks/294322 nonce always set to "0" so what you get is not valid blopck header

darius 2017-10-25T12:29:57.350