A minimal python API for etherscan.io.
Most of the free webhooks from the Accounts, Contracts, Transactions and Tokens modules are supported. Their example use-cases are summarized here.
Before proceeding, you should register an account on etherscan.io and generate a personal API key to use.
Assuming conda is already installed on your system, first create the environment:
conda env create -f env.yml
Activate the environment:
conda activate etherscan-python
Then, install the package:
pip install .
conda activate etherscan-python && bash run_tests.sh
In python
, create a client with your personal etherscan.io API key:
from etherscan.client import Client
api_key = YOUR_API_KEY
config_path = "etherscan/configs/stable.json"
client = Client.from_config(config_path, api_key)
Then you can call all available methods, e.g.:
client.get_eth_balance(address="0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a")
> ('40891631566070000000000', 'OK')
Powered by Etherscan.io APIs.