This Python script allows you to fetch current Ethereum gas prices (safe low, standard, and fast) from Etherscan's API. It can be useful for determining appropriate gas prices for Ethereum transactions based on current network conditions.
- Python 3.x
requests
library (install usingpip install requests
)
-
Clone this repository to your local machine:
-
Navigate to the cloned directory:
-
Run the script:
This will fetch and display the current safe low, standard, and fast gas prices in Gwei.
- Gas prices are subject to change based on Ethereum network conditions. Always verify gas prices before making transactions.
- Handle exceptions appropriately in your application when using this script to fetch gas prices.