3

I'm trying to find an API that lists all the blocks from a specific day, as we can do with bitcoin:

https://blockchain.info/pt/blocks/1515628800000?format=json

I've searched etherscan.io and blockcypher.com APIs, as well as other ones and found nothing. Some APIs can list the latest blocks, but that's not what I need.

Is there any ethereum API similar to the blockchain.info API that can show all the blocks from a specific day?

1
  • Dear @karliwson, Did you find my answer helpful? Jan 24, 2018 at 19:54

1 Answer 1

7
+50

There is no Web API, but you can perform this using SQL.

You can do it simply with "Presto Ethereum Connector" (https://github.com/xiaoyao1991/presto-ethereum)

Using Presto Ethereum, you can query the blocks using an SQL command. You can base the where condition on block_timestamp.

Bellow is the structure of the "block" table provided by Presto Ethereum:

DESCRIBE block;
Column                 | Type               | Extra | Comment
-----------------------------------------------------------
block_number           | bigint             |       |
block_hash             | varchar(66)        |       |
block_parenthash       | varchar(66)        |       |
block_nonce            | varchar(18)        |       |
block_sha3uncles       | varchar(66)        |       |
block_logsbloom        | varchar(514)       |       |
block_transactionsroot | varchar(66)        |       |
block_stateroot        | varchar(66)        |       |
block_miner            | varchar(42)        |       |
block_difficulty       | bigint             |       |
block_totaldifficulty  | bigint             |       |
block_size             | integer            |       |
block_extradata        | varchar            |       |
block_gaslimit         | double             |       |
block_gasused          | double             |       |
block_timestamp        | bigint             |       |
block_transactions     | array(varchar(66)) |       |
block_uncles           | array(varchar(66)) |       |
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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