0

Given a range of block numbers, how can I most efficiently fetch the timestamps for those blocks? I couldn't find a simple call to fetch the timestamp at a certain height other than fetching the full blocks. Is there a more efficient way?

0

The most efficient way would probably be to use Google BigQuery which has entire Ethereum blockchain data indexed and available as public data set. The following query:

SELECT number, timestamp
FROM `bigquery-public-data.crypto_ethereum.blocks`
WHERE number >= 1000000 AND number < 1000010
ORDER BY number;

gives me the following output:

    number  timestamp   
1   1000000 2016-02-13 22:54:13 UTC
2   1000001 2016-02-13 22:54:18 UTC
3   1000002 2016-02-13 22:54:38 UTC
4   1000003 2016-02-13 22:54:40 UTC
5   1000004 2016-02-13 22:55:00 UTC
6   1000005 2016-02-13 22:55:08 UTC
7   1000006 2016-02-13 22:55:10 UTC
8   1000007 2016-02-13 22:55:57 UTC
9   1000008 2016-02-13 22:56:00 UTC
10  1000009 2016-02-13 22:56:14 UTC
  • Ah perfect, this is exactly the sort of thing Iwas looking for. Thank you! – HEXSTAT Admin Dec 22 '19 at 15:53

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.