I need to get data of a block using the block height.

Is there a javascript library to get block data from the Bitcoin blockchain, by connecting to local running node or a 3rd party blockchain provider?

  • What exact data do you need from the block? Would a simple API call to e.g. blockchain.info be enough? – 0xb10c Apr 24 '18 at 18:43
  • @0xb10c Specifically, I want to pull all the transactions that are included in a block. I don't want to be dependent on a third party api provider. It would be better if I could connect to the blockchain by using the js library and query the blockchain directly. – varun Apr 25 '18 at 9:04

bitcoin tools library https://github.com/bitpay/bitcore-lib

Unofficial Node.js client for blockexplorer.com API https://github.com/barto-/blockexplorer

or you can install bitcore full node and use bitcore-lib with that full node

  • Thanks. I'm using the Bitcoin-Core library, which makes it easy to execute bitcoin-cli commands by simply formatting them to camel case. – varun Apr 26 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.