Skip to main content

etherscan-cli

Languate - Python PyPI - License PyPI PyPI - Downloads

A comprehensive command-line interface for Etherscan, based on the etherscan-api-v2 library.

Features

  • Account: Balance, transactions (normal, internal, token, NFT), mined blocks.
  • Contract: ABI, source code, creation info, read-only queries.
  • Transaction: Get details, receipt, status, send raw transactions.
  • Block: Get by number, block rewards, countdown, number by timestamp.
  • Token: Total supply, balance, holders.
  • Stats: ETH price, total supply, gas price.
  • Logs: Query event logs.
  • Multi-chain Support: Support for all chains supported by Etherscan v2 API.
  • Rich Output: Beautiful tables and syntax-highlighted JSON.

Installation

pip install python-etherscan-cli

Configuration

Set your Etherscan API key as an environment variable:

export ETHERSCAN_API_KEY=your_api_key_here

Or provide it via the --api-key option.

Quick Start

# Get ETH price
etherscan-cli stats price

# Get ETH balance
etherscan-cli account balance 0x...

# List transactions
etherscan-cli account txs 0x... --limit 5

# Get contract ABI
etherscan-cli contract abi 0x...

# List supported chains
etherscan-cli chains

Usage

Usage: etherscan-cli [OPTIONS] COMMAND [ARGS]...

  Etherscan CLI - A command line interface for Etherscan API v2.

Options:
  --api-key TEXT      Etherscan API Key
  --chain-id INTEGER  Chain ID (default: 1 for Mainnet)
  --help              Show this message and exit.

Commands:
  account   Account related commands
  block     Block related commands
  chains    List supported chains and their IDs
  contract  Contract related commands
  logs      Event logs related commands
  stats     Stats related commands
  token     Token related commands
  tx        Transaction related commands

License

MIT

Metadata

Release files for python-etherscan-cli 0.1.0

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

Source distribution (sdist)

Source distribution for python-etherscan-cli 0.1.0
File Size Uploaded
python_etherscan_cli-0.1.0.tar.gz 8.8 kB Details

Release files / python_etherscan_cli-0.1.0.tar.gz

Download URL python_etherscan_cli-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eb484e5443c442ed9b83b60da3dde768cb02b5f9f8dd64fed9af44c3109f812b
BLAKE2b-256 checksum
How to use checksums
9e4b76f4cb8f79c572a359326b1d3e019925c912f11e6565eac9dc36024c3bbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

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