Etherscan API V2
name: etherscan-api
by davidtaikocha · published 2026-03-22
$ claw add gh:davidtaikocha/davidtaikocha-etherscan-api---
name: etherscan-api
description: Use when you need to query Etherscan API V2 for onchain activity, contract metadata, ABI/source retrieval, proxy implementation discovery, and transaction/log analysis across EVM chains.
---
# Etherscan API V2
Overview
Use this skill to fetch onchain data from Etherscan-compatible explorers using the unified V2 API.
Core model:
Explorer URLs relevant to this workspace:
Read first:
Required Inputs
Collect these before querying:
Deterministic Workflow
1. Pick `chainid` from `references/network-map.md`.
2. Choose endpoint by intent from `references/endpoint-cheatsheet.md`.
3. Build request on `https://api.etherscan.io/v2/api` with required params.
4. Parse `status`, `message`, `result`.
5. If contract endpoint returns proxy metadata (`Proxy == "1"`), follow `Implementation`.
6. For large history, paginate (`page`, `offset`) and/or narrow block ranges.
Method Selection
| Goal | Module / Action |
| --- | --- |
| Address normal tx history | `account` / `txlist` |
| Address internal tx history | `account` / `txlistinternal` |
| ERC20 transfer history | `account` / `tokentx` |
| Event logs | `logs` / `getLogs` |
| Contract ABI | `contract` / `getabi` |
| Contract source + proxy fields | `contract` / `getsourcecode` |
| Contract deployer + creation tx | `contract` / `getcontractcreation` |
| Tx execution status | `transaction` / `getstatus` |
| Tx receipt status | `transaction` / `gettxreceiptstatus` |
Quick Commands
Set key once:
export ETHERSCAN_API_KEY="<your_key>"Get ABI (Taiko mainnet example):
curl -s "https://api.etherscan.io/v2/api?chainid=167000&module=contract&action=getabi&address=<contract>&apikey=$ETHERSCAN_API_KEY"Get source + proxy metadata (Taiko hoodi example):
curl -s "https://api.etherscan.io/v2/api?chainid=167013&module=contract&action=getsourcecode&address=<contract>&apikey=$ETHERSCAN_API_KEY"Get address activity in block window:
curl -s "https://api.etherscan.io/v2/api?chainid=1&module=account&action=txlist&address=<address>&startblock=<from>&endblock=<to>&page=1&offset=100&sort=desc&apikey=$ETHERSCAN_API_KEY"Get logs for a contract in block window:
curl -s "https://api.etherscan.io/v2/api?chainid=560048&module=logs&action=getLogs&address=<contract>&fromBlock=<from>&toBlock=<to>&page=1&offset=1000&apikey=$ETHERSCAN_API_KEY"Proxy-Aware Contract Handling
When `getsourcecode` returns:
then:
1. Keep runtime call target as proxy address.
2. Fetch ABI/source from implementation address.
3. Decode selectors against implementation ABI.
4. Re-check implementation before privileged write analysis.
Safety Rails
Never skip these checks:
Expected Output
Return:
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...