Skip to main content

Etherscan v2 api client

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etherscan_api_v2-0.3.tar.gz (15.6 kB view details)

Uploaded Source

File details

Details for the file etherscan_api_v2-0.3.tar.gz.

File metadata

  • Download URL: etherscan_api_v2-0.3.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for etherscan_api_v2-0.3.tar.gz
Algorithm Hash digest
SHA256 a993990e127faa6face431a67b494230730ed3351c7b37f48c6ff004e24d330f
MD5 21e8c245ea8d42da5ef1d4ad7f13bfea
BLAKE2b-256 eb171fde231ecbbc7c78ef8f6fe7a5fdf701663e475ebf0428b51939793f48f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page