Assuming that I have a starting block and an ending block and I want to retrieve all the transactions that have occurred between these two blocks, is there any API that can help me achieve this?


You can use web3.js.

In web3, you can get blocks You can also get transaction from block

I let you check all the other functions available.

  • Will I be able to also see all the contracts that are responsible for those transactions in the transaction details of the block? – mzaidi Sep 24 '18 at 9:35
  • Of course. when sending a transaction/call to a contract, the contract address is the "to" parameter. – Florian Castelain Sep 24 '18 at 10:50
  • According to etherscan.io block # 0 has 8893 transaction etherscan.io/block/0, but when I used the command web3.eth.getBlockTransactionCount(0), it returned me 0. Am i using the function incorrectly or there is some other error? – mzaidi Sep 24 '18 at 10:59
  • If you check the transaction list, they are not really transaction, but a state of the chain at its very beginning. This state is set with the genesis file. (that's why they are called "GENESIS_XXX") – Florian Castelain Sep 24 '18 at 11:12

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.