MultiversX Tracker is Live!

How do I get all incoming transactions to an Ethereum address throughout a particular time period with a python script using Alchemy API?

Etherum Reddit

More / Etherum Reddit 93 Views

I have an Alchemy API python script that checks the balance for an Ethereum address. According to the python alchemy-sdk docs, you can set up the Alchemy API object like this:

from alchemy import Alchemy, Network # create Alchemy object using your Alchemy api key, default is "demo" api_key = "your_api_key" # choose preferred network from Network, default is ETH_MAINNET network = Network.ETH_MAINNET # choose the maximum number of retries to perform, default is 5 max_retries = 3 # create Alchemy object alchemy = Alchemy(api_key, network, max_retries=max_retries) 

From here you can get the ether balance of an address like this:

eth_address_balance = alchemy.core.get_balance("ADDRESS", "BLOCK_NUMBER") 

Notice that you can get the address balance at any block height by adding "BLOCK_NUMBER" to the get_balance function.

How would I get all transactions that send ether to a certain address between 2 block heights?

I know your first instinct is to tell me to check Etherscan but I've noticed that some exchanges send ether to my address and no transaction appears on Etherscan... That's why I'm trying to build this script.

submitted by /u/warpanomaly
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments