Etherscan.io API async Python non-official wrapper. Tested with Python 3.10.
Supports all API modules:
Also provides 3rd party utils
module, which allows to fetch a lot of transactions without timeouts and not getting banned.
Supports blockchain explorers:
pip install -U aioetherscan
Register Etherscan account and create free API key.
import asyncio
from aioetherscan import Client
from asyncio_throttle import Throttler
async def main():
c = Client('apikey')
throttler = Throttler(rate_limit=5, period=1.0)
try:
print(await c.stats.eth_price())
print(await c.block.block_reward(123456))
async for t in c.utils.token_transfers_generator(
address='0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
throttler=throttler
):
print(t)
finally:
await c.close()
if __name__ == '__main__':
asyncio.run(main())