Etherscan API
Ethereum blockchain explorer API — balances, transactions, contracts and gas.
What it does
Etherscan’s API exposes Ethereum blockchain data: account ETH and token balances, full transaction and internal-transaction history, ERC-20/721/1155 transfers, contract ABIs and source, event logs, gas oracle and network stats. Etherscan’s V2 API serves 50+ EVM chains from the same key by passing chainid.
Base URL
Authentication
Create a free account and pass your key as &apikey=YOUR_KEY. Requests are GET with module, action and parameters in the query string. V2 multichain: https://api.etherscan.io/v2/api?chainid=1&….
Code examples
curl -s "https://api.etherscan.io/api?module=account&action=balance"\ "&address=0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae&tag=latest&apikey=$ETHERSCAN_KEY"
import requests
r = requests.get("https://api.etherscan.io/api", params={
"module": "account", "action": "txlist",
"address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
"startblock": 0, "endblock": 99999999, "sort": "desc",
"page": 1, "offset": 10, "apikey": KEY}, timeout=15)
data = r.json()
print(data["status"], data["message"], len(data["result"]))Rate limits & quotas
Free tier: 5 calls/second and 100,000 calls/day. Results are wrapped as {status, message, result}; status:"0" signals an error even on HTTP 200. Values are in wei — divide by 10^18 for ETH. Paginate large histories with page/offset.
Key response fields
| result (balance) | Wei string — divide by 1e18 for ETH |
| result[] (txlist) | Transactions with hash, from, to, value, timeStamp |
| result (getabi) | Contract ABI JSON string (verified contracts only) |
| status / message | "1"/OK vs "0"/NOTOK |
Common errors
| status 0, "Invalid API Key" | Key missing, wrong, or not yet activated. |
| status 0, "Max rate limit reached" | Over 5 calls/sec — throttle. |
| status 0, "No transactions found" | Not an error as such — the address simply has none. |
| 403 | Blocked for sustained abuse — contact support. |
When to use it (and alternatives)
The standard for Ethereum (and, via V2, most EVM chains) account history, token transfers and verified-contract source/ABI. For raw JSON-RPC node access use Infura or Alchemy; for a self-hostable open explorer see Blockscout.
FAQ
Do I need a separate key for Polygon, BSC, Arbitrum, etc.?
No longer — Etherscan V2 uses one key across 50+ EVM chains; you pass chainid in the query. The old per-chain domains (polygonscan.com etc.) still work with their own keys.
Why is status '0' with a 200 response?
Etherscan signals API errors in the JSON body. Check data['status'] == '1' before trusting result; '0' with 'No transactions found' is benign.
How do I convert the balance?
It is returned in wei as a string. Divide by 10^18 for ETH (use integer/decimal math, not float, for exact values).
New to APIs?
Short guides for working with this API — and any other.