skillfed

etherscan-python

A minimal, yet complete, python API for etherscan.io.

etherscan-python v2.1.0 100.7K downloads/30d#12,975 on PyPI423
Permissive license MIT Active released

What it is and what it does

etherscan-python wraps Etherscan.io's REST API into a Python client, letting you query Ethereum blockchain data without writing HTTP requests directly. It covers standard endpoints for account balances, transaction history, contract metadata, block information, token transfers (ERC20 and ERC721), gas prices, and network statistics, plus PRO endpoints for historical analytics when you have a paid API key. The client supports Ethereum mainnet and testnets (Kovan, Rinkeby, Ropsten) by passing a network parameter.

You instantiate a client with your API key, then call methods like `get_eth_balance()`, `get_normal_txs_by_address()`, or `get_gas_oracle()` to retrieve data as strings or structured results. The package is minimal—it depends only on requests—and aims for completeness rather than abstraction, exposing most of Etherscan's public API surface directly.

Use it for:

  • Fetch ETH balances and transaction history for addresses to build wallet monitoring or portfolio tracking tools.
  • Retrieve ERC20 and ERC721 token transfer events for a contract or address to audit token movements.
  • Look up smart contract source code and ABI from Etherscan to interact with contracts programmatically.
  • Query gas price estimates and confirmation time predictions to optimize transaction timing.
  • Access block rewards, block timestamps, and network statistics for blockchain analysis or research.
  • Test your code against Ethereum testnets (Ropsten, Rinkeby, Kovan) before mainnet deployment.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a complete Python client for Etherscan.io's blockchain API, covering accounts, contracts, transactions, blocks, tokens, gas tracking, and network statistics across mainnet and testnets.

Yes, if you need to query Etherscan data from Python and are comfortable managing an API key. The package is straightforward, has no complex dependencies, and covers a broad API surface. The main caveat is that the last release was in 2021, so verify that its endpoints match your current Etherscan API needs and that it works with your Python version before relying on it for production.

Install

etherscan-python on PyPI

pip

pip install etherscan-python

uv

uv add etherscan-python

poetry

poetry add etherscan-python

Installing etherscan-python

Before you install

Low friction installation with a single runtime dependency (requests). Repository is active with recent commits as of 2026-06-17, though the package itself has not had a release since 2021-03-31.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.

Quickstart

pip install etherscan-python

from etherscan import Etherscan
eth = Etherscan('YOUR_API_KEY')
balance = eth.get_eth_balance(address='0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a')

Requires a free Etherscan.io account and personal API key; PRO endpoints require a paid subscription.

Verify before relying

  • Whether the package works with current Python versions given no explicit version constraint is specified.
  • Whether recent repository activity indicates active maintenance or if commits are from community contributors.
  • Whether the 2021-03-31 release date means the package is stable or potentially stale relative to Etherscan API changes.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance actively maintained — 1,962 days since the last release
Last repo commit
First released
Downloads 100,736/month — #12,975 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: etherscan_python-2.1.0-py3-none-any.whl

Tags

etherscan api python clientethereum blockchain data queryeth address balance lookuptransaction history ethereumsmart contract abi retrievalethereum testnet apigas price oracleerc20 token transfers
blockchainethereumweb3

More Internet packages