SDKs overview
Etherscan provides access to Ethereum blockchain data primarily through its public API. While Etherscan does not maintain official SDKs, the developer community has created and maintains a variety of client libraries across multiple programming languages. These libraries abstract the HTTP requests and JSON parsing required to interact with the Etherscan API, simplifying data retrieval for developers.
The Etherscan API offers endpoints for a range of data, including:
- Account balances and transaction history
- Block information and miner details
- Smart contract source code verification and ABI retrieval
- Gas price estimates
- Token information (ERC-20, ERC-721, ERC-1155)
Developers rely on these community-contributed libraries to integrate Etherscan's data services into decentralized applications (dApps), analytics platforms, and automated tools. The API itself follows a REST-like architectural style, commonly returning data in JSON format.
Official SDKs by language
As of 2026, Etherscan does not provide or officially maintain any first-party SDKs or client libraries for its API. The Etherscan documentation portal directs developers to use the raw API endpoints or leverage community-developed libraries. This approach places the responsibility for client library maintenance and feature parity with the Etherscan API on the open-source community.
Developers needing to interact with the Etherscan API must either construct HTTP requests manually or select a community library that supports their preferred programming language. The following table highlights this structure:
| Language | Package Name (Example) | Install Command (Example) | Maturity / Status |
|---|---|---|---|
| Python | etherscan-python |
pip install etherscan-python |
Community-maintained |
| JavaScript / TypeScript | etherscan-api |
npm install etherscan-api |
Community-maintained |
| Go | go-etherscan |
go get github.com/nanmu42/go-etherscan |
Community-maintained |
| PHP | etherscan/api |
composer require etherscan/api |
Community-maintained |
| Rust | etherscan-api |
cargo add etherscan-api |
Community-maintained |
| .NET (C#) | Etherscan.NET |
dotnet add package Etherscan.NET |
Community-maintained |
Installation
Installation of Etherscan client libraries typically follows the standard package management practices for each programming language. Below are common installation methods for popular community-maintained libraries.
Python
For Python, the etherscan-python library is a common choice. Install it using pip:
pip install etherscan-python
JavaScript / TypeScript
For Node.js environments, etherscan-api is often used. Install it via npm or yarn:
npm install etherscan-api
# or
yarn add etherscan-api
Go
For Go projects, a library like go-etherscan can be integrated:
go get github.com/nanmu42/go-etherscan
PHP
PHP developers can use Composer to install libraries such as etherscan/api:
composer require etherscan/api
Rust
Rust libraries like etherscan-api are added to your project's Cargo.toml dependencies:
cargo add etherscan-api
.NET (C#)
For .NET applications, Etherscan.NET can be installed using the .NET CLI or NuGet Package Manager:
dotnet add package Etherscan.NET
After installation, you will need an Etherscan API Key, which can be obtained by registering on the Etherscan APIs page. API keys are essential for making authenticated requests and managing rate limits.
Quickstart example
This quickstart demonstrates fetching the Ether balance for a specific address using a Python community library, etherscan-python. Ensure you have installed the library and obtained your API key from Etherscan.
Python Example: Get Ether Balance
import os
from etherscan.accounts import Account
from pprint import pprint
# Replace with your actual Etherscan API key
# It's recommended to load this from environment variables or a secure configuration.
API_KEY = os.environ.get("ETHERSCAN_API_KEY", "YOUR_ETHERSCAN_API_KEY")
# Initialize the Account API client
# For mainnet, use network='mainnet'
# For other networks (e.g., Ropsten, Kovan), specify accordingly.
account_api = Account(address="0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", api_key=API_KEY, network='mainnet')
# Example: Get Ether balance for a single address
# The address '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' is vitalik.eth's address.
balance = account_api.get_eth_balance(address="0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae")
print(f"Ether balance for 0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae: {balance} Wei")
# Convert Wei to Ether (1 Ether = 10^18 Wei)
eth_balance = int(balance) / (10**18)
print(f"Ether balance: {eth_balance} ETH")
# Example: Get normal transactions for an address
# transactions = account_api.get_normal_txs_by_address(address="0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", startblock=0, endblock=99999999, sort='asc')
# print("\nRecent Transactions:")
# pprint(transactions[:5]) # Print first 5 transactions
This example demonstrates the basic pattern:
- Import the necessary module from the library.
- Provide your Etherscan API key.
- Instantiate the client for the desired API module (e.g.,
Account). - Call the relevant method (e.g.,
get_eth_balance) with the required parameters. - Process the returned data.
For more detailed API calls and different modules (e.g., Contract, Transaction, Block), refer to the etherscan-python library documentation or the generic Etherscan API documentation.
Community libraries
The Etherscan ecosystem thrives on community contributions for client libraries. These libraries wrap the core Etherscan API, providing idiomatic access for various programming languages. While Etherscan does not officially endorse or maintain these, they are widely used and often well-supported by their respective communities.
Key considerations when choosing a community library include:
- Language Support: Availability for Python, JavaScript, Go, PHP, Rust, .NET, and others.
- API Coverage: How many Etherscan API endpoints does the library support? Is it comprehensive or limited to specific modules?
- Maintenance Status: Is the library actively maintained? Check the last commit date, open issues, and pull request activity on its GitHub repository.
- Documentation: Is the library well-documented with examples and clear usage instructions?
- Community Activity: Are there active discussions, forums, or issues being addressed by contributors?
- Error Handling: How does the library handle API rate limits, invalid requests, or network issues?
Developers are encouraged to review the source code and community feedback for any chosen library to ensure it meets their project's requirements for reliability and security. Reputable community projects often link directly from GitHub repositories or package manager sites. For example, Python developers might explore the etherscan-python package on PyPI, while JavaScript users might look at etherscan-api on npm.
These libraries significantly reduce the boilerplate code required to interact with Etherscan's data, allowing developers to focus on application logic rather than low-level HTTP requests and response parsing.