LogoLogo
HomeMetadata APIAPI PROTwitter
Etherscan V2
Etherscan V2
  • Introduction
  • Chef's Pick
  • Rate Limits
  • V1 to V2 API Migration Guide
  • ✨Getting Started
    • Creating an Account
    • Getting an API Key
    • Supported Chains
    • Supported Endpoints
  • 🎯API Endpoints
    • Nametags
    • Accounts
    • Contracts
    • Transactions
    • Blocks
    • Logs
    • Geth/Parity Proxy
    • Tokens
    • Gas Tracker
    • Stats
    • L2 Deposits/Withdrawals
    • Usage
  • 🏆API PRO
    • Etherscan API PRO
    • Metadata/Name Tag API
  • 🍳Cookbook
    • Track Uniswap V4 DEX Trades
  • Get An Address's Full Transaction History
  • 🤝Support
    • FAQ
    • Legacy V1 Docs
    • Checking Usage
    • Common Error Messages
    • Getting Help
  • Visit Etherscan.io
Powered by GitBook
On this page
  • Why V2
  • Single API Key

Introduction

NextChef's Pick

Last updated 4 months ago

This V2 update is aimed at a single goal, of unifying EVM data across .

Why V2

With the rise of multichain apps, many projects' GitHub repositories resemble a ( shortened ) version of this.

ETHERSCAN_API_KEY=VZFDUWB3YGQ1YCDKTCU1D6DDSS
BSCSCAN_API_KEY=ZM8ACMJB67C2IXKKBF8URFUNSY
SNOWSCAN_API_KEY=ATJQERBKV1CI3GVKNSE3Q7RGEJ
ARBISCAN_API_KEY=B6SVGA7K3YBJEQ69AFKJF4YHVX
OPTIMISM_API_KEY=66N5FRNV1ZD4I87S7MAHCJVXFJ

ETHERSCAN_API_URL=https://api.etherscan.io/api
BSCSCAN_API_KEY=https://api.bscscan.com/api
SNOWSCAN_API_KEY=https://api.snowscan.xyz/api
ARBISCAN_API_KEY=https://api.arbiscan.io/api
OPTIMISM_API_KEY=https://api-optimistic.etherscan.io/api

As support for Etherscan explorers across multiple chains grew, so did the fragmentation of the developer experience.

Single API Key

You can now query data from any of our with a single API key.

This includes features like contract verification ✅, fetching transactions across chains 🔵 and more.

To add support for a new chain, simply append its chain ID to your array, like this JavaScript ( intern can't get Python installed on Windows )

const chains = [42161, 8453, 10, 534352, 81457]

for (const chain of chains) {

  // endpoint accepts one chain at a time, loop for all your chains
  const balance = fetch(`https://api.etherscan.io/v2/api?
     chainid=${chain}
     &module=account
     &action=balance
     &address=0xb5d85cbf7cb3ee0d56b3bb207d5fc4b82f43f511
     &tag=latest&apikey=YourApiKeyToken`)
     
}

We don't currently support on all chains. Please feel free to if you need something specific!

🤝
50+ chains
50+ supported chains
all endpoints
reach out