Skip to main content

Etherscan api

Etherscan v2 api client

Install

pip install etherscan-api-v2

Usage

from etherscan_api import EtherScanApi, get_etherscan_api
from pprint import pprint

# view all supported chains and chain_id
pprint(EtherScanApi.chain_list())

# get api client
etherscan = EtherScanApi(chain_id=1)
etherscan = get_etherscan_api('eth', network='mainnet')

account = '0x3f217aF5b4d5Dc6467598937119E500ab758623a'
usdt = '0x58c885900f2df7a1fb1cc1ec35dea9a1c786cac0'

# get token balance 
balance = etherscan.get_token_balance(account, usdt)

# query contract
balance = etherscan.query_contract(usdt, 'balanceOf', account)

Metadata

Release files for etherscan-api-v2 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for etherscan-api-v2 0.3
File Size Uploaded
etherscan_api_v2-0.3.tar.gz 15.6 kB Details

Release files / etherscan_api_v2-0.3.tar.gz

Download URL etherscan_api_v2-0.3.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a993990e127faa6face431a67b494230730ed3351c7b37f48c6ff004e24d330f
BLAKE2b-256 checksum
How to use checksums
eb171fde231ecbbc7c78ef8f6fe7a5fdf701663e475ebf0428b51939793f48f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page