On-Chain Data API Guide链上数据 API 指南

Choose a Free On-Chain Data API
for Your Application
选择适合应用的
免费链上数据 API

Compare wallet, transaction, token, contract, historical, and real-time data coverage before you commit to a free blockchain API.

比较钱包、交易、代币、合约、历史与实时数据覆盖,
再选择适合应用的免费区块链数据接口。

Whiteboard workflow for selecting a free on-chain data API by data type, network coverage, free-tier limits, and integration method

TL;DR: choosing a free on-chain data API核心结论:如何选择免费链上数据 API

Define the output

Start with the exact balance, transaction, transfer, token, contract event, block, or historical series your application needs.

Verify “free”

Distinguish a permanent free tier from a trial. Record authentication, daily and burst quotas, retained history, attribution, and upgrade triggers.

Match the network

Confirm mainnet and testnet support, chain identifiers, finality, reorg behavior, archive depth, and whether one schema works across networks.

Test before launch

Validate timestamps, pagination, units, nulls, errors, rate-limit headers, caching, retries, monitoring, and a fallback with representative requests.

先定义输出

先明确应用需要余额、交易、转账、代币、合约事件、区块,还是历史时间序列。

核验“免费”

区分长期免费层与限时试用,记录鉴权、日配额、突发限制、历史范围、署名与升级条件。

匹配网络

确认主网、测试网、链 ID、最终性、链重组处理、归档深度,以及多链是否共用统一 Schema。

上线前测试

用代表性请求验证时间戳、分页、单位、空值、错误、限流、缓存、重试、监控与回退。

Define the blockchain data API output first先定义区块链数据 API 的输出

Wallet balances and transaction history钱包余额与交易历史

For a wallet balance API, verify native assets, fungible tokens, NFTs, pending transactions, spam filtering, fiat valuation, block height, and source timestamp. Transaction history should document internal transactions, traces, fees, status, pagination, and decoded labels.

钱包余额接口应说明原生资产、同质化代币、NFT、待确认交易、垃圾资产过滤、法币估值、区块高度和源时间戳。交易历史还应说明内部交易、调用轨迹、手续费、状态、分页与解码标签。

Token transfers, holders, and contract events代币转账、持币地址与合约事件

Token and smart contract APIs need stable contract addresses, token decimals, event signatures, log indexes, transaction hashes, and chain IDs. Holder lists and portfolio views may be indexed or derived rather than direct node responses.

代币与智能合约数据接口需要稳定的合约地址、精度、事件签名、日志索引、交易哈希与链 ID。持币地址和资产组合通常来自索引或衍生计算,并非节点直接响应。

Historical and real-time on-chain data历史与实时链上数据

Historical on-chain data requires archive depth, deterministic time boundaries, backfill pagination, and revision handling. Real-time blockchain data may arrive through polling, webhooks, WebSocket subscriptions, or streams; record confirmation policy and duplicate-event behavior.

历史链上数据需要明确归档深度、确定性时间边界、回填分页与修订处理。实时链上数据可通过轮询、Webhook、WebSocket 或流式接口获取,应记录确认策略和重复事件处理。

Derived metrics need entity labels and explicit formulas派生链上指标需要实体标签与明确公式

Active addresses, new addresses, exchange inflow, realized value, holder concentration, and supply in profit are analytics products, not raw chain fields. Their values depend on address clustering, change-address heuristics, contract and bridge filters, exchange-label coverage, price sources, time boundaries, and confirmation policy. Store the metric definition, network, block range, label-set version, price vintage, and calculation version with every observation. An address is not automatically one user, and a token transfer is not automatically an independent economic flow.

活跃地址、新增地址、交易所流入、已实现价值、持币集中度和盈利供应量都属于分析指标,并非链上原始字段。结果会受到地址聚类、找零地址识别、合约与跨链桥过滤、交易所标签覆盖、价格来源、时间边界和确认策略影响。每条观测都应保存指标定义、网络、区块范围、标签集版本、价格版本和计算版本。一个地址不一定对应一个用户,一笔代币转账也不一定代表一笔独立经济流。

Worked exchange-flow example: internal transfers are not deposits or withdrawals交易所资金流案例:内部调拨不是充值或提现

Assume confirmed external transfers into a labeled exchange cluster total 100 BTC during one UTC day, while confirmed transfers from the cluster to external entities total 70 BTC. Under the declared formula, net exchange inflow is 100 − 70 = +30 BTC. During the same day, the exchange moves 500 BTC from a labeled hot wallet to a new cold wallet. If the cold wallet is not yet included in the label set, a naive address-based calculation reports an additional 500 BTC outflow and changes the day to 100 − (70 + 500) = −470 BTC. Once both wallets are recognized as the same exchange entity, the internal movement contributes zero to external net flow and the result returns to +30 BTC.

Do not silently rewrite the old series when a label is added. Retain the first-known result, publish the corrected result under a new label-set version, and expose the revision time and reason. Also specify whether bridge contracts, custodians, omnibus wallets, mining pools, mixers, token mints and burns, failed transactions, and reorged blocks are included. For alerts, wait for the chosen confirmation threshold and make corrections reversible; for historical research, query the metric version that was actually available at the study cutoff.

交易所资金流案例:内部调拨不是充值或提现

假设某个 UTC 自然日内,外部实体向已标记交易所地址集合转入 100 BTC,交易所向外部实体转出 70 BTC,且这些交易都已达到规定确认数。按照已声明公式,交易所净流入为 100 − 70 = +30 BTC。同一天,交易所又把 500 BTC 从已标记的热钱包调拨到一个尚未标记的新冷钱包。若标签集还不知道该冷钱包属于同一家交易所,按地址计算的简单方法会额外记录 500 BTC 流出,使当日结果变成 100 − (70 + 500) = −470 BTC。当两个钱包都被识别为同一交易所实体后,这笔内部调拨对外部净流量的贡献应为零,结果才恢复为 +30 BTC。

新增标签后不能静默改写旧序列。系统应保留首次可得结果,在新的标签集版本下发布更正值,并披露修订时间和原因。同时要说明跨链桥合约、托管机构、综合钱包、矿池、混币器、代币铸造与销毁、失败交易和被重组区块是否计入。用于告警时,应等待规定确认数并支持可逆更正;用于历史研究时,则应查询研究截止时点真正可获得的指标版本。

REST API

Good for request-response lookups such as an address balance, transaction detail, or paginated transfer history.

GraphQL API

Useful when applications need selected fields and related entities from an indexed multi-chain data model.

JSON-RPC

Provides chain-native methods but often requires decoding, indexing, batching, archive access, and reorg handling in your own stack.

WebSocket and webhooks

Support near-real-time events; verify delivery guarantees, retry signatures, ordering, confirmation depth, and reconnect behavior.

REST API

适合查询地址余额、交易详情或分页转账历史等请求—响应场景。

GraphQL API

适合从已索引的多链数据模型中选择字段并关联实体。

JSON-RPC

提供链原生方法,但通常需要自行完成解码、索引、批处理、归档访问与重组处理。

WebSocket 与 Webhook

用于近实时事件;应核验投递保证、重试签名、顺序、确认深度与重连行为。

Choose the right on-chain data source model选择正确的链上数据来源模型

“On-chain data API” covers several products with different tradeoffs. A raw node method, an indexed address-history endpoint, a decoded event API, and an analytics dataset may all describe the same transaction differently. Choose the source model before comparing providers.

“链上数据 API”包含多种取舍不同的产品。原始节点方法、已索引的地址历史接口、已解码事件 API 和分析数据集,可能用不同方式描述同一笔交易。因此应先选择数据来源模型,再比较服务商。

Source model来源模型Returns主要输出Best fit适合场景Work you still own仍需自行处理
JSON-RPCBlocks, receipts, logs, state区块、回执、日志、状态Chain-native control链原生控制Decoding, indexing, reorgs解码、索引、链重组
Indexed REST索引型 RESTWallet and transaction history钱包与交易历史Wallets, tax, portfolio apps钱包、税务、资产组合应用Provider schema mapping服务商 Schema 映射
GraphQLSelected entities and relations选定实体与关联关系Custom indexed queries自定义索引查询Query cost and pagination查询成本与分页
Streams / webhooks流 / WebhookNew blocks, transfers, events新区块、转账与事件Alerts and live automation告警与实时自动化Ordering, dedupe, replay顺序、去重与重放

Raw data versus decoded data原始数据与解码数据

Raw logs preserve protocol-level detail but require ABIs and chain-specific logic. Decoded APIs are faster to integrate, yet their labels, token metadata, spam rules, and protocol classifications become part of your application’s data dependency.

原始日志保留协议级细节,但需要 ABI 和链特定逻辑。解码后的 API 接入更快,不过其标签、代币元数据、垃圾资产规则与协议分类也会成为应用的数据依赖。

Indexed data versus live node state索引数据与节点实时状态

An index can answer historical and cross-entity questions efficiently, but it may lag the chain tip. Node state is closer to the network and useful for verification, while deep history may require archive access and many calls.

索引适合高效回答历史与跨实体问题,但可能落后于链尖。节点状态更接近网络,适合核验;深度历史则可能需要归档节点和大量调用。

Compare free on-chain data API options比较免费链上数据 API 选项

Criterion检查项What to verify核验内容Why it matters重要性Caveat注意事项
CoverageNetworks, mainnets, testnets, data types, archive depth.公链、主网、测试网、数据类型、归档深度。Prevents silent gaps.避免静默缺口。Verify each endpoint.逐端点核验。
Free tierRequests, credits, burst rate, history, trial expiry.请求量、积分、突发速率、历史范围、试用到期。Defines usable capacity.决定可用容量。Terms can change.条款可能变化。
FreshnessBlock height, source time, confirmations, update cadence.区块高度、源时间、确认数、更新频率。Separates live from delayed.区分实时与延迟。Measure in your test.以实测为准。
OperationsErrors, status page, changelog, SDKs, export, fallback.错误、状态页、变更记录、SDK、导出、回退。Supports reliable use.支持可靠使用。Free is not an SLA.免费不等于 SLA。

Compare one representative response, not endpoint counts比较代表性响应,不要只看端点数量

Request the same wallet, block range, and token transfer from each candidate. Compare chain ID, block number, transaction index, log index, status, timestamp, address casing, decimals, native value, fee fields, pagination cursor, and error shape. A shorter endpoint list with stable identifiers can be more useful than hundreds of loosely defined fields.

用每个候选服务查询相同的钱包、区块范围和代币转账,并比较链 ID、区块号、交易索引、日志索引、状态、时间戳、地址格式、精度、原生币金额、手续费字段、分页游标与错误结构。标识稳定、定义清晰的少量端点,可能比数百个模糊字段更有价值。

Read free blockchain API limits correctly正确理解免费区块链 API 的限制

A “free API” can mean an unauthenticated public endpoint, a recurring monthly allowance, promotional credits, or a time-limited trial. These are not interchangeable. Capture the terms on the day you test and avoid designing a production dependency around a quota that is not guaranteed to renew.

“免费 API”可能指无需鉴权的公共端点、每月自动重置的额度、促销积分或限时试用,它们不能混为一谈。测试当天应记录条款,不要围绕无法保证续期的额度设计生产依赖。

Request accounting

Learn whether one HTTP request, each returned record, compute units, or chain-specific credits consume quota. Batch calls may have different weights.

Rate and concurrency

Record requests per second, burst windows, concurrent streams, webhook delivery limits, 429 headers, and reset behavior.

Data access

Check archive depth, supported networks, premium-only decoded fields, maximum page size, bulk export, and retention.

Usage rights

Review display, caching, storage, attribution, redistribution, commercial-use, and derived-data conditions.

请求计费方式

确认配额按 HTTP 请求、返回记录、计算单元还是链特定积分扣减;批量调用可能使用不同权重。

速率与并发

记录每秒请求、突发窗口、并发流、Webhook 投递限制、429 响应头和额度重置行为。

数据访问范围

检查归档深度、支持网络、付费专属解码字段、最大页大小、批量导出与数据保留。

使用权利

核验展示、缓存、存储、署名、再分发、商业使用与衍生数据条件。

Free access is not an SLA. A useful prototype limit does not establish uptime, support, notice periods, or recovery guarantees.

免费访问不等于 SLA。足够原型使用的额度,并不代表可用性、支持、变更通知或恢复保证。

How to integrate a free blockchain data API如何接入免费区块链数据接口

1. Write a data contract

Specify chain, entity, fields, time range, finality, maximum staleness, pagination, and allowed empty results before choosing an endpoint.

2. Run representative requests

Test a funded wallet, empty wallet, token contract, failed transaction, long history, latest block, and unsupported network.

3. Normalize and validate

Keep raw payloads, version field mappings, validate addresses and numeric units, and store source plus ingestion timestamps separately.

4. Add quota-aware controls

Keep keys server-side, cache by freshness need, bound retries with jitter, handle 429 separately, monitor quotas, and define a fallback.

1. 编写数据契约

选择端点前先明确链、实体、字段、时间范围、最终性、最大陈旧时间、分页和允许的空结果。

2. 运行代表性请求

测试有余额钱包、空钱包、代币合约、失败交易、长历史、最新区块与不支持的网络。

3. 标准化并验证

保留原始响应,对字段映射进行版本管理,验证地址和数值单位,并分别保存源时间与采集时间。

4. 添加配额感知控制

Key 保存在服务端,按新鲜度缓存,对 429 单独处理,限制重试并加入抖动,监控配额并准备回退。

Define a minimum normalized response定义最低标准化响应

{
  "chainId": "eip155:1",
  "blockNumber": 00000000,
  "transactionHash": "0x…",
  "timestamp": "ISO-8601",
  "asset": {"address": "0x…", "decimals": 18},
  "valueRaw": "0",
  "status": "confirmed",
  "sourceRetrievedAt": "ISO-8601"
}

Preserve raw integer values instead of accepting floating-point conversions, and store provider payload samples for debugging. Add provider-specific fields outside the normalized core so switching sources does not silently change product behavior.

应保留原始整数值,避免直接接受浮点转换,并保存服务商响应样本用于排错。把服务商特有字段放在标准化核心之外,避免切换数据源时静默改变产品行为。

Worked example: decode once, identify once, finalize later实算示例:先解码、再唯一识别、最后确认

A token transfer with raw value 123456789 and contract decimals 6 represents 123456789 ÷ 10⁶ = 123.456789 tokens. Keep the raw integer as a string and derive the display amount with decimal-safe arithmetic; changing the token metadata or reading the amount as a binary floating-point number must not rewrite the source event. Identify the log with chain ID + transaction hash + log index, not transaction hash alone, because one transaction can emit several transfers.

一条代币转账的原始整数为 123456789,合约精度为 6,实际数量就是 123456789 ÷ 10⁶ = 123.456789 枚。应把原始整数以字符串保存,再用十进制安全算法生成展示数量;代币元数据发生变化或程序使用二进制浮点数,都不能改写来源事件。日志的唯一键应由 chain ID + transaction hash + log index 组成,不能只使用交易哈希,因为一笔交易可能触发多条转账日志。

Confirmation is a state transition, not a permanent property at first sight. Record the block number and hash, transaction and log indexes, observed time, provider ingestion time, confirmation count, and finality policy. If an event first appears in block N with hash A but a reorganization later makes hash B canonical at the same height, mark the A event removed or reverted and process the canonical replacement idempotently. Do not leave both in balances or alerts. The required confirmation depth is network- and use-case-specific; expose pending, confirmed, finalized, and reverted states rather than presenting the first observation as irreversible.

确认状态会变化,首次看到事件时并不代表它已经永久成立。应保存区块高度与区块哈希、交易和日志索引、首次观察时间、供应商入库时间、确认数及最终性策略。如果事件最初出现在高度 N、区块哈希为 A,随后链重组使同一高度的哈希 B 成为主链,就应把 A 中的事件标记为已移除或已回滚,并以幂等方式处理主链替代事件,不能让两条记录同时进入余额或告警。所需确认深度取决于网络与业务场景,应明确展示 pendingconfirmedfinalizedreverted 状态,而不是把首次观测写成不可逆事实。

Test an on-chain data API before production生产使用前测试链上数据 API

Build a representative acceptance set建立代表性验收数据集

  • A funded address and an address with no history.
  • A successful transaction, failed transaction, internal call, and token transfer.
  • A contract with proxy upgrades or multiple event versions.
  • A long historical range that forces pagination.
  • The latest block plus a deliberately unsupported chain or malformed address.
  • 一个有余额地址和一个无历史地址。
  • 成功交易、失败交易、内部调用与代币转账。
  • 发生过代理升级或包含多个事件版本的合约。
  • 必然触发分页的长历史范围。
  • 最新区块,以及刻意使用的不支持链或错误地址。

Verify correctness and consistency验证正确性与一致性

Cross-check critical samples with a block explorer or chain-native RPC. Repeat identical requests to detect unstable identifiers, missing rows, changing pagination, or inconsistent timestamps. Test around a known chain reorganization or wait for additional confirmations where the network makes that practical.

用区块浏览器或链原生 RPC 交叉核验关键样本。重复相同请求,检查标识不稳定、记录缺失、分页变化或时间戳不一致。条件允许时,应在已知链重组附近测试,或等待更多确认后再次比较。

Plan monitoring, backfill, and fallback规划监控、回填与故障回退

Monitor source lag, ingestion lag, null spikes, missing block ranges, schema drift, quota consumption, 429s, and provider errors. Backfills should be idempotent by chain, block, transaction, and log index. A fallback needs an explicit reconciliation rule because two providers may normalize the same event differently.

监控源延迟、采集延迟、空值激增、区块缺口、Schema 漂移、配额消耗、429 与服务错误。回填应按链、区块、交易和日志索引保持幂等。故障回退还需要明确的对账规则,因为两个服务商可能以不同方式标准化同一事件。

Use QVeris to find on-chain data API capabilities用 QVeris 查找链上数据 API 能力

Describe the required output in QVeris provider details—for example wallet transaction history, token transfers, or multi-chain balances—then inspect candidate input and output schemas before making a call.

QVeris 服务商详情中描述所需输出,例如钱包交易历史、代币转账或多链余额,再在调用前检查候选能力的输入输出 Schema。

  • Use the Capability Map to explore related data capabilities.
  • Inspect schemas and required parameters before connecting a capability to an application or agent.
  • Verify provider limits, licenses, chain coverage, and freshness in official documentation; QVeris does not replace that review.
  • 使用能力地图探索相关数据能力。
  • 把能力接入应用或 Agent 前,先检查 Schema 与必需参数。
  • 服务商限制、许可、多链覆盖与数据新鲜度仍需在官方文档中核验。

Free on-chain data API FAQ免费链上数据 API 常见问题

Is there a free API for on-chain data?

Yes. Providers offer public endpoints, trials, or ongoing free tiers for balances, transactions, transfers, blocks, contracts, and indexed data. Limits and rights vary.

How do I get on-chain data through an API?

Choose a chain-native JSON-RPC endpoint or an indexed REST, GraphQL, WebSocket, or webhook API, then test its schema, coverage, quota, freshness, and errors.

What is the best free blockchain API?

The best option is the one that matches your networks, data types, history, update speed, quota, license, and operational requirements. There is no universal winner.

Can I query multiple blockchains with one API?

Some multi-chain APIs normalize several networks behind one schema. Verify chain-specific fields and feature gaps instead of assuming identical coverage.

Do free on-chain APIs need an API key?

Some public endpoints do not; many free tiers require a key for quota and abuse controls. Never expose a privileged key in browser code.

Can a free blockchain data API be used in production?

Only when its license, capacity, availability, change policy, monitoring, and fallback meet your application’s risk requirements.

有免费的链上数据 API 吗?

有。部分服务提供公共端点、试用或长期免费层,可查询余额、交易、转账、区块、合约与索引数据,但限制和使用权不同。

如何通过 API 获取链上数据?

可选择链原生 JSON-RPC,或已索引的 REST、GraphQL、WebSocket 与 Webhook 接口,再测试覆盖、配额、新鲜度与错误。

免费区块链 API 哪个好?

应按所需网络、数据类型、历史范围、更新速度、配额、许可与运维要求选择,不存在适合所有场景的唯一答案。

一个 API 能查询多条公链吗?

部分多链数据 API 使用统一 Schema 覆盖多条网络;仍需逐链核验特有字段和功能缺口。

免费链上 API 需要 API Key 吗?

部分公共端点不需要,很多免费层会用 Key 做配额和滥用控制。不要在浏览器代码中暴露高权限 Key。

免费接口可以用于生产环境吗?

只有许可、容量、可用性、变更策略、监控和回退满足应用风险要求时才适合。

External references外部参考链接