Ethereum: .csv file of every block timestamp in btc history

CSV File with Ethereum Block: Complete source of the history of Bitcoin

Bitcoin Blockchain has undergone significant changes since its start in 2009 and new blocks have been incredibly added to the network. One aspect of this process, which can be difficult to follow manually, is the block stamp that is recorded on the blockchain as part of each block created.

In this article, we offer a solution to obtain a complete CSV file containing all the blocks in the history of Bitcoin at the height of the block. This file allows you to download and analyze the historical data related to each block.

How it works

You can use the “Blockchain.info” API to get the desired CSV file, which offers a simple way to download block thymphamps from the blockchain. So it’s:

1
Register an account : Register for a free account [bitcoin.com] ( or other reputation.

  • Create a new portfolio : Create a new Bitcoin portfolio using the “Createwallet” termination point. This generates a public address and a private key that can be used to sign transactions and receive payments.

  • Get an API -Tokent

    : Ask an API -TOKEN to your recorded account. You will need this token to authenticate the Blockchain.info API.

  • Use the following termination point: https: // api.blockchain.info / API / V1 / Blockchain / TIMEPAN.JSON.

API response

The API’s response contains a series of objects that each represent a single horoditing block with the following attributes:

  • `Timetamp ': the horoditing of the block in seconds since January 1, 2009.

  • Block_height: the height of the right block on the blockchain.

  • Previous_hash: hexadecimal representation of hash from the previous block.

  • Hash: hexadecimal representation of Hash of the current block.

Here is an example of an API response:

JSON

[

{{

"Horodat": 1000000,

"Block_height": 1,

"Previous_hash": "...

},

{{

"Horodat": 20000000,

"Block_height": 2,

...

}

]]

'

Generation CSV

You can use the Python "CSVKit" directory to convert the API response to the CSV file. Here is an example of code detail:

Python

Import of CSV

Def Generate_CSV (File_Path):

Open (file_path, 'W') like CSVILE:

Writer = CSV.Writer (CSVILE)

header = ['horodat', 'block_height', 'previously_hash', 'hash']

Writer.writerow (header)

For the answer in API_respons:

Timestamp = int (reply ['timeamp']) / 1000

Block_height = answer ['block_height']

Previous_hash = hex (answer ['previously_hash'])

hash = hex (response ['hash'])

Writer.writerow ([Timesamp, Block_height, Prever_hash, hash])

Replace 'API_RESPROSE' for the current response of Blockchain.info

Generate_csv ('ethereum_block_timestamps.csv')

` ‘

This code generates a CSV file called Ethereum_Block_TimesTamps.csv “in the current work library. Each line of the file represents unique horoding in the history of Bitcoin, including blocking, the height of the block, the previous hash and the hatching.

Conclusion

Obtaining a complete CSV file, which contains a horoditing in the history of Bitcoin, is now easier than ever with the height of the block with the height of the block. By following these steps, you can generate a reliable source to analyze the historical data linked to each block.

اشتراک گذاری