Migrate from Etherscan

Etherscan API V2 serves every chain from one base URL, selecting the chain with a chainidquery parameter. Routescan's Etherscan-compatible API works the same way with the chain id in the path, so switching over is a base-URL change: your module/action calls and response handling stay the same.

Swap the base URL

Etherscan V2 selects the chain with ?chainid=; Routescan puts it in the path as the {chainId} segment, next to a {network} segment. Everything after etherscan/api stays identical.

Etherscan API V2: the chain is a ?chainid= query parameter.
https://api.etherscan.io/v2/api?chainid=1&module=account&action=balance&address=0xde0b...bae&tag=latest&apikey=YourEtherscanKey
Routescan (Etherscan-compatible): the chain id moves into the path; module and action stay the same.
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=account&action=balance&address=0xde0b...bae&tag=latest
  • {network}: mainnet or testnet.
  • {chainId}: the target chain's numeric id (the same value you pass as Etherscan's chainid; see Supported chains).

One key, every chain

Like Etherscan V2, a single apikey works across every chain (no per-explorer keys), and it is optional on the free tier. Change only the {chainId} segment to cover every chain Routescan indexes. See Supported chains, API keys & pricing and Rate limits, and browse the modules under the Etherscan-compatible API.

Automate the migration with an LLM

Open your codebase in an AI assistant (Claude, Cursor, ChatGPT, …) and paste the prompt below to convert your Etherscan calls automatically:

textCopy code
1You are migrating this codebase to Routescan's Etherscan-compatible API. The source may use Etherscan API V2 (https://api.etherscan.io/v2/api?chainid=...), a legacy V1 endpoint (https://api.etherscan.io/api?...), or a per-explorer host (e.g. https://api.basescan.org/api).
2 
3All of them share the same module/action query format and response shapes, so this is a base-URL change. Response parsing must stay the same.
4 
5Rules:
61. Rewrite the request URL to:
7 https://api.routescan.io/v2/network/{network}/evm/{chainId}/etherscan/api
8 where {network} is "mainnet" or "testnet" and {chainId} is the numeric chain id.
92. Determine {chainId}: from Etherscan V2 it is the ?chainid= value; from a V1 or per-explorer URL it is that explorer's chain (e.g. 1 = Ethereum, 43114 = Avalanche C-Chain). Drop the ?chainid= query parameter once it is in the path.
103. Keep every other query parameter unchanged: module, action, address, contractaddress, startblock, endblock, page, offset, sort, tag, etc.
114. Do NOT change any response-handling code; the JSON shapes are Etherscan-compatible (status / message / result).
125. The "apikey" parameter is optional on Routescan's free tier; leave existing keys in place or drop them.
136. Use ONLY these chain ids that Routescan supports. If a chain is not in this list, leave the call unchanged and flag it for manual review instead of guessing a chain id.
14 Mainnet: none
15 Testnet: 13337 (Beam), 168587773 (Blast Sepolia), 28882 (Boba Sepolia), 88882 (Chiliz Spicy), 21000001 (Corn), 432201 (Dexalot), 335 (DFK), 55197 (Egmtester), 43113 (Fuji), 743111 (Hemi), 560048 (Hoodi), 6911 (Nibiru Testnet-2), 9746_5 (Plasma), 3012 (PLAYA3ULL Games), 153_2 (Redbelly Testnet), 11155111 (Sepolia), 723107 (Tixchain)
16 
17Output:
18- The migrated code itself: the rewritten Routescan calls ready to drop in (updated file contents or an applyable diff), with response-handling code unchanged.
19- For any chain not in the supported list above, leave that call unchanged and flag it explicitly (file, line, and the chain) as needing manual review.
Questions? Contact us