- Notifications
You must be signed in to change notification settings - Fork0
A minimal, yet complete, python API for Etherscan.io.
License
rstms/rstms-etherscan-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A minimal, yet complete, python API foretherscan.io.
All of thefree GET endpoints from the following modules are provided:
Before proceeding, you should register an account onetherscan.io and generate a personal API key to use.
Assumingconda 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.Test that everything looks OK on your end before proceeding:
coverage run -m unittest discover&& coverage report -mThis will regenerate the logs underlogs/ with the most recent results and the timestamp of the execution.
Inpython , create a client with your personal etherscan.io API key:
frometherscanimportEtherscanapi_key=YOUR_API_KEYconfig_path="etherscan/configs/stable.json"eth=Etherscan.from_config(config_path,api_key)
Then you can call all available methods, e.g.:
eth.get_eth_balance(address="0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a")>'40891631566070000000000'
Examples (arguments and results) for all methods may be found as JSON fileshere. For example, if you want to use the methodget_block_number_by_timestamp , you can find the supported arguments and the format of its output in its respectiveJSON file:
{"method":"get_block_number_by_timestamp","module":"blocks","kwargs": {"timestamp":"1578638524","closest":"before" },"log_timestamp":"2020-09-30-15:39:18","res":"9251482"}wherekwargs refer to the required arguments andres refers to the expected result if you run:
eth.get_block_number_by_timestamp(timestamp="1578638524",closest="before")
Disclaimer: Those examples blindly use the arguments originally showcasedhere and the selected wallets/contracts do not reflect any personal views. You should refer to the same source for additional information regarding specific argument values.
For problems regarding installing or using the package please open anissue. If you think that a newly-added method is missing, also open an issue as a feature request and I will do my best to add it. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.
Powered byEtherscan.io APIs.
About
A minimal, yet complete, python API for Etherscan.io.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Python84.8%
- Makefile15.0%
- Shell0.2%