Search code examples
python-3.xblockchainethereumweb3py

How to get all transaction data from the entire Ethereum network using web3py


I'm trying to run some analysis on cryptocurrency(e.g. Bitcoin, Ethereum) data but having trouble finding data sources. For example, I'd like to collect transaction data such as input address, output address, transaction time, transaction amount, etc. for Ethereum.

I've found that I can access Ethereum data with web3py but is it possible to get data for "ALL" transactions that have made recently in the entire Ethereum network, not just the transactions connected to my own wallet(address)? For example, I'd like to get data on all Ethereum transaction occurred today.

Also, do I must have my own Ethereum wallet(address) in order to access their data with web3py? I wonder whether I need a specific address as a starting point or I can just scrape the data without creating a wallet.

Thanks.


Solution

  • For example, I'd like to collect transaction data such as input address, output address, transaction time, transaction amount, etc. for Ethereum.

    You can iterate over all blocks and transactions using web3.eth.get_block call. You need, however, parse the transaction content yourself.

    To access all the data, it is recommended that you run your own node to have the maximum network bandwidth for JSON-RPC calls.

    Also, do I must have my own Ethereum wallet(address) in order to access their data with web3py?

    Address is just a derived from a random number and you do not need to generate one.