Etherscan API

The Etherscan API is the developer layer of Etherscan, the dominant Ethereum block explorer and analytics platform — providing RESTful endpoints that give programmatic access to virtually all data Etherscan has indexed from the Ethereum blockchain: account transaction histories, ERC-20/ERC-721 token transfer logs, smart contract source code and ABI for verified contracts, internal transactions from EVM execution, gas price estimates and history, and direct contract interaction endpoints for reading state. Etherscan has indexed Ethereum since the genesis block and is the default source of blockchain data for wallets, portfolio trackers, analytics tools, security platforms, and DeFi integrations that need historical transaction data or contract metadata without running their own full archive node. The API offers a free tier (5 API calls per second, most features included) sufficient for many applications, with Pro tiers providing higher rate limits, additional endpoints, and multi-chain access. Equivalent Etherscan-branded explorers exist for most major EVM-compatible chains — BscScan (BSC), PolygonScan (Polygon), Arbiscan (Arbitrum), Basescan (Base) — each with their own API keys and the same API structure.


Key API Endpoints

The following sections cover this in detail.

Account Endpoints

GET https://api.etherscan.io/api

?module=account

&action=txlist

&address=0xAddress

&startblock=0

&endblock=99999999

&sort=asc

&apikey=APIKEY

# Get ERC-20 token transfers

&action=tokentx

&contractaddress=0xUSDCAddress # optional: filter by token

# Get ERC-721 NFT transfers

&action=tokennfttx

# Get internal transactions

&action=txlistinternal

“`

Contract Endpoints

# Get ABI of verified contract

&module=contract

&action=getabi

&address=0xContractAddress

# Get source code of verified contract

&action=getsourcecode

&address=0xContractAddress

# Returns: SourceCode, ABI, ContractName, CompilerVersion, etc.

“`

Gas/Stats Endpoints

# Get current gas prices (Gwei)

&module=gastracker

&action=gasoracle

# Returns: SafeGasPrice, ProposeGasPrice, FastGasPrice

# Get ETH total supply

&module=stats

&action=ethsupply

“`


Contract Verification

Etherscan allows contract authors to submit source code for verification — after verification, the source code is publicly visible on Etherscan and accessible via API:

  • Manual: Upload via Etherscan UI
  • Foundry: forge verify-contract --chain mainnet
  • Hardhat: npx hardhat verify --network mainnet
  • vs. unverified: Unverified contracts show only bytecode; getabi returns error

Rate Limits & Tiers

Tier Calls/sec Price
Free 5/sec Free
Standard 20/sec $199/mo
Advanced 50/sec $399/mo
Ultimate 100/sec Custom

Multi-Chain Explorer APIs

Same API structure, different base URL:

  • Ethereum: api.etherscan.io
  • Polygon: api.polygonscan.com
  • BSC: api.bscscan.com
  • Arbitrum: api.arbiscan.io
  • Base: api.basescan.org

Related Terms


Sources

  1. “Etherscan: Ethereum’s Transparency Layer and API Infrastructure” — Etherscan Team (2015-2023). Comprehensive overview of Etherscan’s architecture — how the platform indexes Ethereum blockchain data, the database and indexing systems behind the explorer, how the API translates low-level blockchain data into developer-friendly endpoints, and the infrastructure behind 99.9% uptime for 2M+ daily API calls.
  1. “Etherscan API in Practice: Common Integration Patterns” — Alchemy / Developer Guide (2022). Practical guide to integrating the Etherscan API into production applications — covering authentication, pagination, error handling, combining with node RPC calls, and common patterns for portfolio trackers, wallets, and analytics tools.
  1. “Smart Contract Verification on Etherscan: Best Practices and Tooling” — OpenZeppelin / Contract Security (2022-2023). Guide to verifying smart contract source code on Etherscan — explaining the verification process, compiler settings matching, proxy contract verification with implementation display, and why verification is security-critical for user trust and protocol transparency.
  1. “Etherscan Gas Oracle: How Gas Estimation Works” — Ethereum Foundation / Gas Research (2022). Technical analysis of Etherscan’s gas oracle — how SafeGasPrice, ProposeGasPrice, and FastGasPrice are calculated from mempool and historical block data, how accurate the estimates are for different transaction inclusion time targets, and how wallets and dApps use gas oracle data for fee suggestions.
  1. “Etherscan API Alternatives: Comparing Alchemy, Moralis, QuickNode for Indexed Blockchain Data” — Developer Relations / Multi-Chain Infrastructure (2023). Comparative analysis of Etherscan API vs. competing blockchain data APIs (Alchemy NFT API, Moralis Historical API, QuickNode Streams) — examining data completeness, rate limits, multi-chain support, pricing, and which tools cover data gaps that Etherscan API doesn’t address.