开发者 API
OpenAPI快速开始
curl --fail --silent 'https://inkexplorer.xyz/testnet/api/explorer/blocks'const base = "https://inkexplorer.xyz/testnet/api";
const response = await fetch(base + '/explorer/blocks');
if (!response.ok) throw new Error('HTTP ' + response.status);
const page = await response.json();
console.log(page.items);
if (page.next_page_params) {
const cursor = new URLSearchParams(page.next_page_params);
const next = await fetch(base + '/explorer/blocks?' + cursor);
console.log(await next.json());
}JSON-RPC · Ink Sepolia
通过 Ink Explorer 读取链上数据并模拟调用。不支持签名或广播交易。
RPC 请求使用 HTTP POST。打开地址可查看支持的方法和限制。 链 ID: 763373 (0xba5ed).
curl --fail --silent 'https://inkexplorer.xyz/testnet/api/rpc' \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'const response = await fetch("https://inkexplorer.xyz/testnet/api/rpc", {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]})
});
const result = await response.json();
if (!response.ok || result.error) throw new Error(result.error?.message || 'HTTP ' + response.status);
console.log(BigInt(result.result));支持的 RPC 方法 (23)
eth_chainIdnet_versionweb3_clientVersioneth_blockNumbereth_syncingeth_gasPriceeth_maxPriorityFeePerGaseth_getBalanceeth_getCodeeth_getTransactionCounteth_getStorageAteth_getBlockByNumbereth_getBlockByHasheth_getBlockTransactionCountByNumbereth_getBlockTransactionCountByHasheth_getTransactionByHasheth_getTransactionReceipteth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_calleth_estimateGaseth_feeHistoryeth_getLogs
RPC 限制:每批 20 次调用,每个 IP 每分钟 120 次调用,每次日志查询最多 2000 个区块。
实时索引事件请使用下方的浏览器 WebSocket。此 RPC 仅支持 HTTP。
接口
GET/overview网络概览
URL: https://inkexplorer.xyz/testnet/api/overview
JSON: { ... }
GET/explorer/blocks区块
URL: https://inkexplorer.xyz/testnet/api/explorer/blocks
参数: type=block | reorg
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/blocks/{height-or-hash}区块
URL: https://inkexplorer.xyz/testnet/api/explorer/blocks/{height-or-hash}
JSON: { ... }
GET/explorer/blocks/{height-or-hash}/transactions交易
URL: https://inkexplorer.xyz/testnet/api/explorer/blocks/{height-or-hash}/transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/transactions交易
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/v1/transactions筛选后的交易
URL: https://inkexplorer.xyz/testnet/api/v1/transactions
参数: transaction_types, methods, age_from, age_to, from_address_hashes_to_include, to_address_hashes_to_include, address_relation, status, cursor
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/transactions/{hash}交易哈希
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions/{hash}
JSON: { ... }
GET/explorer/transactions/{hash}/token-transfers代币转账
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions/{hash}/token-transfers
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/transactions/{hash}/internal-transactions内部交易
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions/{hash}/internal-transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/transactions/{hash}/logs事件日志
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions/{hash}/logs
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/internal-transactions内部交易
URL: https://inkexplorer.xyz/testnet/api/explorer/internal-transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/addresses热门账户
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/addresses/{address}地址
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses/{address}
JSON: { ... }
GET/address-balance/{address}ETH 余额
URL: https://inkexplorer.xyz/testnet/api/address-balance/{address}
JSON: { schema: 1, chainId, address, balance: "wei", block: { number, hash, timestamp }, observedAt, source: "local" }
GET/explorer/addresses/{address}/counters地址计数
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses/{address}/counters
JSON: { ... }
GET/explorer/addresses/{address}/transactions地址交易
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses/{address}/transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/addresses/{address}/token-transfers代币转账
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses/{address}/token-transfers
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/addresses/{address}/internal-transactions内部交易
URL: https://inkexplorer.xyz/testnet/api/explorer/addresses/{address}/internal-transactions
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/tokens代币
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens
参数: type=ERC-20 | ERC-721 | ERC-1155
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/tokens/{address}代币
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}
JSON: { ... }
GET/explorer/tokens/{address}/transfers代币转账
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}/transfers
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/tokens/{address}/holders代币持有者
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}/holders
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/tokens/{address}/instancesNFT 实例
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}/instances
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/tokens/{address}/instances/{token-id}NFT 实例
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}/instances/{token-id}
JSON: { ... }
GET/explorer/tokens/{address}/instances/{token-id}/transfersNFT 转移
URL: https://inkexplorer.xyz/testnet/api/explorer/tokens/{address}/instances/{token-id}/transfers
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/token-transfers代币转账
URL: https://inkexplorer.xyz/testnet/api/explorer/token-transfers
参数: type=ERC-20 | ERC-721 | ERC-1155
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/optimism/depositsL1 → L2 存款
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/deposits
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/optimism/withdrawalsL2 → L1 提款
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/withdrawals
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/optimism/batches交易批次
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/batches
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/optimism/batches/count交易批次数
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/batches/count
JSON: 12345
GET/explorer/optimism/batches/{number}交易批次
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/batches/{number}
JSON: { ... }
GET/explorer/optimism/games争议
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/games
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/optimism/games/count争议数量
URL: https://inkexplorer.xyz/testnet/api/explorer/optimism/games/count
JSON: 12345
GET/explorer/blocks/optimism-batch/{number}批次中的区块
URL: https://inkexplorer.xyz/testnet/api/explorer/blocks/optimism-batch/{number}
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/transactions/optimism-batch/{number}批次中的交易
URL: https://inkexplorer.xyz/testnet/api/explorer/transactions/optimism-batch/{number}
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/proxy/account-abstraction/operations用户操作
URL: https://inkexplorer.xyz/testnet/api/explorer/proxy/account-abstraction/operations
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/proxy/account-abstraction/operations/{hash}用户操作
URL: https://inkexplorer.xyz/testnet/api/explorer/proxy/account-abstraction/operations/{hash}
JSON: { ... }
GET/explorer/smart-contracts已验证合约
URL: https://inkexplorer.xyz/testnet/api/explorer/smart-contracts
JSON: { items: [...], next_page_params: { ... } | null }
GET/explorer/smart-contracts/{address}智能合约
URL: https://inkexplorer.xyz/testnet/api/explorer/smart-contracts/{address}
JSON: { ... }
GET/explorer/stats网络统计
URL: https://inkexplorer.xyz/testnet/api/explorer/stats
JSON: { ... }
GET/contract-info/poolsDEX 流动性池
URL: https://inkexplorer.xyz/testnet/api/contract-info/pools
JSON: { items: [...], next_page_params: { ... } | null }
GET/contract-info/pools/{address-or-id}DEX 流动性池
URL: https://inkexplorer.xyz/testnet/api/contract-info/pools/{address-or-id}
JSON: { ... }
GET/dapps去中心化应用
URL: https://inkexplorer.xyz/testnet/api/dapps
JSON: [{ ... }, ...]
GET/stats/counters网络总数
URL: https://inkexplorer.xyz/testnet/api/stats/counters
JSON: { counters: [...] }
GET/stats/lines所有统计
URL: https://inkexplorer.xyz/testnet/api/stats/lines
JSON: { sections: [...] }
GET/stats/lines/{metric}图表
URL: https://inkexplorer.xyz/testnet/api/stats/lines/{metric}
参数: from=YYYY-MM-DD, to=YYYY-MM-DD, resolution=DAY | WEEK | MONTH | YEAR
JSON: { chart: [...] }
GET/search搜索
URL: https://inkexplorer.xyz/testnet/api/search
参数: q
JSON: { items: [...], next_page_params: { ... } | null }
GET/live/configWebSocket 配置
URL: https://inkexplorer.xyz/testnet/api/live/config
JSON: { ... }
GET/live/statusWebSocket 状态
URL: https://inkexplorer.xyz/testnet/api/live/status
JSON: { ... }
GET/live/snapshot最新区块和交易
URL: https://inkexplorer.xyz/testnet/api/live/snapshot
JSON: { ... }
GET/network网络状态
URL: https://inkexplorer.xyz/testnet/api/network
JSON: { ... }
交易筛选
筛选匹配父交易,其代币转账和内部调用不会单独成行。
curl --get --fail 'https://inkexplorer.xyz/testnet/api/v1/transactions' \
--data-urlencode 'transaction_types=CONTRACT_INTERACTION' \
--data-urlencode 'methods=0xa9059cbb' \
--data-urlencode 'age_from=2026-10-01T00:00:00Z'- transaction_types
- COIN_TRANSFER, CONTRACT_INTERACTION, CONTRACT_CREATION, ERC-20, ERC-721, ERC-1155
- methods
- 四字节选择器,例如0xa9059cbb。
- from_address_hashes_to_include / to_address_hashes_to_include
- 完整0x地址。两个条件默认使用AND,设置address_relation=or时使用OR。
- age_from / age_to
- ISO 8601 · UTC
- status
- success | failed
- cursor
- 使用next_page_params返回的不透明游标。每页保持相同筛选条件。
失败交易不会产生代币转账事件。请选择“合约交互”查看失败的代币调用。
分页
将next_page_params全部键复制到下一请求。null表示列表结束。不要计算区块偏移,也不要更换筛选条件后复用游标。
筛选页可能很短或为空,但仍有下一游标。请继续;结果按父交易哈希去重。
ERC 代币搜索每页最多核验 25 笔父交易。请继续使用游标浏览后续事件。
WebSocket
const socket = new WebSocket("wss://inkexplorer.xyz/testnet/api/live");
socket.onmessage = ({data}) => {
const event = JSON.parse(data);
if (event.protocol !== 'ink-observer.live.v1') return;
if (event.network?.chainId !== 763373) return;
console.log(event.block, event.transactions, event.utilization, event.rolling24h);
};
// Reconnect with backoff after a close.
// The welcome frame is a fresh snapshot.区块由节点事件推送。交易可能先于回执出现,只有status ok确认执行成功。重组后按高度和哈希替换区块。
ink-explorer.delta.v1
通过WebSocket子协议启用。reset替换本地状态;后续帧按高度合并区块、按哈希合并交易。删除已替换区块和窗口外的交易。利用率覆盖30个主链区块。
new WebSocket("wss://inkexplorer.xyz/testnet/api/live", 'ink-explorer.delta.v1')限制与错误
实例共享最多4个并发搜索、每分钟60次查询。每次最多扫描3个源页面。其他接口遵循上游限制。遇到429时遵守Retry-After并使用指数退避。
- 200
- 成功
- 202
- BLOCK_INDEXING · Retry-After: 3 · Accept: application/vnd.ink.indexing+json, application/json
TRANSACTION_INDEXING · Retry-After: 1 · Accept: application/vnd.ink.transaction-indexing+json, application/json - 400
- 参数或游标无效。
- 404
- 接口不存在。
- 405
- 只读接口。请使用GET。
- 429
- 已达频率限制,请稍后重试。
- 502 / 503
- 数据源或连接不可用,请逐步延长重试间隔。
数值与时效性
Wei金额是十进制字符串。请使用BigInt和代币精度,避免浮点舍入。ETH有18位小数。图表单位由指标目录声明。
区块和回执来自本地节点。历史记录和图表目前来自Ink索引。请检查X-Ink-Data-Status和X-Ink-Data-Fetched-At;保留的数据不是新观测。
显示的区块总数来自本地节点。索引器计数器不提供计算时间。
/live/snapshot → block.height + 1 · 本地节点的规范链区块数,包含创世区块(区块 0)。
/live/snapshot → rolling24h.transactions · 过去 24 小时内纳入规范链区块的交易,包括失败交易和 L1/系统存款。统计窗口截至所示区块。
即使获取时间是最新的,索引器的汇总数据也可能落后于最新区块。
最新区间可能不完整。UTC日与滚动24小时统计的时间范围不同。总费用包含L2执行和L1数据费用;运营方费用请查看回执。