/install etherscan-api
Etherscan API V2
Overview
Use this skill to fetch onchain data from Etherscan-compatible explorers using the unified V2 API.
Core model:
- One base URL:
https://api.etherscan.io/v2/api - One API key
- Switch chains via
chainid
Explorer URLs relevant to this workspace:
- Ethereum mainnet:
https://etherscan.io/ - Ethereum hoodi:
https://hoodi.etherscan.io/ - Taiko mainnet:
https://taikoscan.io/ - Taiko hoodi:
https://hoodi.taikoscan.io/
Read first:
references/network-map.mdreferences/endpoint-cheatsheet.mdreferences/rate-limits.mdreferences/explorer-url-patterns.md
Required Inputs
Collect these before querying:
ETHERSCAN_API_KEY- Target
chainid - Address / tx hash / block range
- Endpoint intent (activity, logs, source, ABI, status)
Deterministic Workflow
- Pick
chainidfromreferences/network-map.md. - Choose endpoint by intent from
references/endpoint-cheatsheet.md. - Build request on
https://api.etherscan.io/v2/apiwith required params. - Parse
status,message,result. - If contract endpoint returns proxy metadata (
Proxy == "1"), followImplementation. - 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="\x3Cyour_key>"
Get ABI (Taiko mainnet example):
curl -s "https://api.etherscan.io/v2/api?chainid=167000&module=contract&action=getabi&address=\x3Ccontract>&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=\x3Ccontract>&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=\x3Caddress>&startblock=\x3Cfrom>&endblock=\x3Cto>&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=\x3Ccontract>&fromBlock=\x3Cfrom>&toBlock=\x3Cto>&page=1&offset=1000&apikey=$ETHERSCAN_API_KEY"
Proxy-Aware Contract Handling
When getsourcecode returns:
Proxy: "1"- non-empty
Implementation
then:
- Keep runtime call target as proxy address.
- Fetch ABI/source from implementation address.
- Decode selectors against implementation ABI.
- Re-check implementation before privileged write analysis.
Safety Rails
Never skip these checks:
- Always set correct
chainid; wrong chain silently yields wrong context. - Respect plan limits and add client-side throttling/retries.
- Treat
status: "0"as non-success even with HTTP 200. - For analytics windows, lock
startblock/endblockexplicitly. - For logs, remember
offsetmax is 1000 per query and paginate. - Keep retries idempotent and resume scans from stored cursors/block checkpoints.
Expected Output
Return:
- exact URL/query used (without exposing secret key)
- chain (
chainid+ explorer) - endpoint (
module/action) - parsed status/result summary
- proxy follow-up decisions (
Proxy,Implementation) when contract-related
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install etherscan-api - 安装完成后,直接呼叫该 Skill 的名称或使用
/etherscan-api触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Etherscan 是什么?
Use when you need to query Etherscan API V2 for onchain activity, contract metadata, ABI/source retrieval, proxy implementation discovery, and transaction/lo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 476 次。
如何安装 Etherscan?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install etherscan-api」即可一键安装,无需额外配置。
Etherscan 是免费的吗?
是的,Etherscan 完全免费(开源免费),可自由下载、安装和使用。
Etherscan 支持哪些平台?
Etherscan 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Etherscan?
由 David(@davidtaikocha)开发并维护,当前版本 v1.0.0。