# On-chain data API: nodes, indexers, SQL compared

URL: https://fincodelabs.com/en/blog/on-chain-data-api · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Category: Fintech development · Published: 2026-11-27 · Updated: 2026-11-27

On-chain data APIs as of 26 Nov 2026: node RPC, enhanced APIs, indexers and SQL warehouses, vendor limits and prices from their pages, one query run two ways.

**Short answer:** An **on-chain data API** answers questions about blockchain state and history, through one of four layers: node JSON-RPC, an enhanced node API, an indexer such as a subgraph or explorer, or a SQL warehouse. They differ mainly in history depth, freshness, reorganization handling and how they bill. In a test on 26 November 2026, the same five-block Ethereum query returned 458 identical logs from a public node in 0.22 seconds and from an explorer indexer in 2.91 seconds.

Teams usually pick an on-chain data provider by its free tier and find the real constraints later: a block-range cap on logs, a commercial-use clause, or an indexer that lags the chain. This guide sorts the options by architecture first, then describes four vendors alphabetically from their own documentation and pricing pages read on 26 November 2026. It does not rank them, and no referral links are used. For exchange trades and order books, which are not on-chain data, see the [crypto tick data guide](https://fincodelabs.com/en/blog/crypto-tick-data).

This is an engineering guide. It does not recommend any token, chain or provider.

## Four kinds of blockchain data API

Every on-chain data API sits on one of four layers, and the layer decides what is cheap, what is slow and what can go wrong.

**Architecture comparison (general characteristics; vendor specifics below are dated)**

| Layer | What you get | Strong at | Weak at |
| --- | --- | --- | --- |
| Raw node JSON-RPC | Standard methods: `eth_getLogs`, `eth_getBalance`, `eth_call`, Solana `getTransaction` | Freshest data, block tags for finality, portable between providers | No "all transfers for this address" call; history needs an archive node; you decode everything |
| Enhanced node API | Provider endpoints such as transfers by address, token balances, webhooks | Saves building an indexer for common questions | Provider lock-in; billing in provider units |
| Indexer or subgraph | Pre-built tables queried by REST or GraphQL: explorer APIs, subgraphs | History by address or entity, pagination, decoded events | Lags the chain; coverage limited to what was indexed |
| SQL warehouse | Decoded tables across chains, queried in SQL | Aggregates, research, joins across protocols | Minutes, not milliseconds; credit-based cost per query |

Most production systems combine two layers: a node or webhook for what just happened, and an indexer or warehouse for history and reporting. The [Etherscan API guide](https://fincodelabs.com/en/blog/etherscan-api) covers one explorer indexer in depth, and the [wallet tracking API guide](https://fincodelabs.com/en/blog/wallet-tracking-api) covers the push side.

## One query two ways: node eth_getLogs versus an indexer

Asking a node and an indexer for the same event logs is the quickest way to see the trade-off: both returned the same 458 USDC transfer logs, the node about 13 times faster.

The script reads the latest finalized Ethereum block, then asks for USDC `Transfer` events in the five blocks up to it, once from a free public node with `eth_getLogs` and once from the Blockscout explorer's Etherscan-compatible `getLogs`. Neither needs a key.

```python
import time, datetime, requests

NODE = "https://ethereum-rpc.publicnode.com"           # free public node, no key
INDEXER = "https://eth.blockscout.com/api"             # Blockscout explorer API, no key
USDC = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
TRANSFER = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
H = {"User-Agent": "Mozilla/5.0"}

def node(method, params):
    r = requests.post(NODE, json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params},
                      headers=H, timeout=30)
    r.raise_for_status()
    j = r.json()
    if "error" in j:
        raise RuntimeError(j["error"])
    return j["result"]

fin = int(node("eth_getBlockByNumber", ["finalized", False])["number"], 16)
start, end = fin - 4, fin            # five finalized blocks
print("checked", datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds"),
      "blocks", start, "to", end)

t = time.perf_counter()
logs = node("eth_getLogs", [{"fromBlock": hex(start), "toBlock": hex(end),
                             "address": USDC, "topics": [TRANSFER]}])
print(f"node eth_getLogs: {len(logs)} logs in {time.perf_counter() - t:.2f}s")

t = time.perf_counter()
r = requests.get(INDEXER, params={"module": "logs", "action": "getLogs", "fromBlock": start,
                 "toBlock": end, "address": USDC, "topic0": TRANSFER}, headers=H, timeout=30)
idx = r.json().get("result") or []
print(f"indexer getLogs:  {len(idx)} logs in {time.perf_counter() - t:.2f}s")

a = {(l["transactionHash"], int(l["logIndex"], 16)) for l in logs}
b = {(l["transactionHash"], int(l["logIndex"], 16)) for l in idx}
print("same set:", a == b, "| only node:", len(a - b), "| only indexer:", len(b - a))
if logs:
    l = logs[0]
    print("first:", int(l["blockNumber"], 16), l["transactionHash"][:14] + "...",
          int(l["data"], 16) / 10**6, "USDC")
```

Output on 26 November 2026:

```
checked 2026-11-26T20:44:08+00:00 blocks 26501746 to 26501750
node eth_getLogs: 458 logs in 0.22s
indexer getLogs:  458 logs in 2.91s
same set: True | only node: 0 | only indexer: 0
first: 26501746 0x46a7bdebb657... 0.000591 USDC
```

On finalized blocks the two sources agreed exactly, matched by transaction hash and log index. The node answered in 0.22 seconds against 2.91 for the indexer, and 2.91 / 0.22 is about 13. That is one run from one location, so treat it as an illustration, not a benchmark. Three limits surfaced the same day:

- The public node refused a five-block `eth_getLogs` call without an `address` filter, answering `Please specify an address in your request`; a single-block call without a filter was accepted. Free public nodes restrict exactly the open-ended queries an indexer exists for.
- Alchemy's `eth_getLogs` page caps the block range on its free plan at 10 blocks on Ethereum and other large chains, against unlimited on Pay As You Go, with every response capped at 150 MB.
- Blockscout's limits page gives 300 requests per minute per IP without a key as the default, and carries a notice that per-instance API access, which `eth.blockscout.com/api` is, will be deprecated on 1 July (no year given) in favour of its keyed multichain API. The endpoint still answered on 27 November 2026.

## Alchemy, Dune, Moralis and The Graph APIs as of November 2026

The four vendors searched most with "api" sit on different layers, so their prices are not comparable line by line; the table reports what each page says.

**From each vendor's own pricing or documentation pages, read 26 November 2026, alphabetical, not ranked**

| Vendor | Layer | Free access | Paid entry point as stated | Billing unit |
| --- | --- | --- | --- | --- |
| Alchemy | Node and enhanced APIs, webhooks | 30M compute units a month, 300 CU per second | Pay As You Go at $0.52 per 1M CU | Compute units: `eth_getLogs` 60, `eth_getBalance` 20, `alchemy_getAssetTransfers` 120; webhooks 0.04 CU per byte |
| Dune | SQL warehouse | View-only; no API without a trial or paid plan | Plans named Analyst, Plus and Enterprise; figures not shown in readable form on the pricing page | Credits for execution, export (10 per MB on Analyst, 2 on Plus) and writes |
| Moralis | Enhanced APIs, Streams, RPC | No free plan listed; a free trial set up on request | Starter $149 a month with 2M compute units and 40 RPS; Pro $249 with 100M | Compute units |
| The Graph | Subgraph indexer | 100,000 queries a month | $2 per 100,000 queries beyond that; card or crypto | Queries |

Moralis's Starter figure of 2M compute units against 100M on Pro looks inconsistent, but it is what the page and its comparison table showed on 26 November 2026; confirm it with the vendor before budgeting. Dune's rate limits page lists 70 requests per minute for write-heavy and 200 for read-heavy endpoints on Plus, and a 32 GB maximum result size. The Graph's GraphQL reference caps `first` at 1,000 rows per query (default 100) and recommends cursor paging with `id_gt` instead of large `skip` values.

> **Hypothetical example.** A reporting job makes 2,000,000 `eth_getLogs` calls a month on Alchemy. At 60 CU each that is 120M CU; minus the free 30M leaves 90M, which at $0.52 per 1M is $46.80 a month under the published Pay As You Go rate. The same job on a subgraph would be priced per query instead: 2,000,000 queries minus 100,000 free, at $2 per 100,000, is $38. Neither number includes the engineering to build or maintain the subgraph, which is usually the larger cost.

## Reorgs, finality and lag in on-chain data APIs

Recent blocks can be replaced, so any API serving the chain head must either wait for finality or tell you when data was removed; each layer handles this differently.

- **Node.** Ethereum JSON-RPC accepts the block tags `latest`, `safe` and `finalized`. On 26 November 2026 a public node reported latest 26501859, safe 26501814 and finalized 26501782: finalized trailed the head by 77 blocks. In a separate test the finalized tag did not move at all during a 60-second wait. Reading only to `finalized` removes reorg handling at the cost of minutes of delay.
- **Webhooks.** Alchemy's address activity payload carries a `removed` flag for transactions dropped in a reorganization. Moralis Streams sends two webhooks per event, unconfirmed and confirmed, says the confirmed one can arrive first, and bills only confirmed ones.
- **Subgraphs.** The Graph's GraphQL reference says a query by block hash for a block that is not yet final can be affected by a concurrent reorganization, while results for final blocks are not. The `_meta` field returns the block a subgraph has indexed to, which is how you measure lag.
- **SQL warehouses.** Expect tables to trail the chain, and design reports on settled periods.

Whatever the source, store the block number and hash with each row, so a later reorganization can be detected by comparing hashes instead of re-reading everything.

## Data licensing and terms of use

On-chain data is public, but an API's output is licensed by its terms, and some free tiers exclude commercial use.

Etherscan's pricing page, read 26 November 2026, labels its Free, Lite and Standard plans as personal and research use, with commercial application use from Advanced. Dune's billing page says free access after a trial is view-only, without API exports. Read the terms of each provider before showing its data to customers, caching it long-term or reselling derived datasets, and keep a record of which source fed which table. The same diligence applies to market data generally, as covered in [what to check before you commit to a financial data API](https://fincodelabs.com/en/blog/financial-data-api).

## Choosing an on-chain data architecture

Start from the question the product must answer and the freshness it needs, then pick the cheapest layer that answers it.

**Matching use cases to layers (general guidance)**

| Need | Usual first layer | Check before committing |
| --- | --- | --- |
| Balance or contract state now | Node RPC | Archive access if you need past blocks |
| Full history for an address | Explorer or enhanced transfers API | Records per request, chain coverage, commercial terms |
| Alerts within seconds | Webhook or node subscription | Retry policy, duplicate handling, reorg flag |
| Protocol-specific entities | Subgraph | Indexing lag via `_meta`, query pricing |
| Aggregates and research | SQL warehouse | Credit cost per query, API availability on your plan |
| Full control and reproducibility | Own node plus own indexer | Storage, operations, and a store such as [ClickHouse](https://fincodelabs.com/en/blog/clickhouse-market-data) |

Keep the boundary between standard RPC and provider-specific APIs visible in code, so a second provider can be added for failover. Several documentation sites read for this guide, including Blockscout's, Dune's and Etherscan's, open their pages with notes addressed to AI agents; those notes were read as page content and not followed. Building and running this kind of pipeline is what Fincode's [market data pipelines](https://fincodelabs.com/en/services/market-data-pipelines) page describes.

## Frequently asked questions

### What is the difference between a node API and an indexer API?

A node answers standard JSON-RPC calls about current state and blocks, but cannot list everything an address did without scanning. An indexer has already processed the chain into tables, so it answers history questions quickly but lags the newest block.

### Is The Graph API free?

Subgraph Studio's pricing page, read 26 November 2026, gives 100,000 free queries a month and charges $2 per 100,000 after that. Every query URL needs an API key.

### Does Dune have a free API?

Not as of 26 November 2026. Dune's documentation says free access is view-only and API usage requires an active trial or a paid plan.

### Why does eth_getLogs fail on a free endpoint?

Free endpoints limit open-ended log queries. A public node refused a multi-block call without an address filter on 26 November 2026, and Alchemy's free plan caps the range at 10 blocks on Ethereum.

### How do on-chain data APIs handle reorgs?

Nodes let you read only finalized blocks; webhook services mark removed events or send confirmed and unconfirmed versions; subgraphs are reliable for final blocks. Store block hashes so you can detect changes yourself.

## Sources

- [Alchemy: Pricing (read 26 November 2026)](https://www.alchemy.com/pricing)
- [Alchemy docs: Compute Unit Costs](https://www.alchemy.com/docs/reference/compute-unit-costs)
- [Alchemy docs: eth_getLogs, supported block ranges](https://www.alchemy.com/docs/chains/ethereum/ethereum-api-endpoints/eth-get-logs)
- [Alchemy docs: Address Activity Webhook](https://www.alchemy.com/docs/reference/address-activity-webhook)
- [Dune docs: Rate Limits](https://docs.dune.com/api-reference/overview/rate-limits)
- [Dune docs: Billing](https://docs.dune.com/api-reference/overview/billing)
- [Moralis: Pricing (read 26 November 2026)](https://moralis.com/pricing/)
- [Moralis docs: Receive Your First Webhook (confirmed and unconfirmed)](https://docs.moralis.com/streams/quickstart/receive-your-first-webhook)
- [The Graph: Subgraph Studio pricing (read 26 November 2026)](https://thegraph.com/studio-pricing/)
- [The Graph docs: GraphQL API](https://thegraph.com/docs/en/subgraphs/querying/graphql-api/)
- [The Graph docs: How to Query a Subgraph](https://thegraph.com/docs/en/subgraphs/querying/introduction/)
- [Blockscout docs: Requests and Limits](https://docs.blockscout.com/devs/apis/requests-and-limits)
- [ethereum.org: JSON-RPC API, block parameter](https://ethereum.org/developers/docs/apis/json-rpc/)
- [Etherscan: API plans and pricing (read 26 November 2026)](https://etherscan.io/api/pricing)

> This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/blog/on-chain-data-api

Cite as: Fincode, "On-chain data API: nodes, indexers, SQL compared", updated November 27, 2026, https://fincodelabs.com/en/blog/on-chain-data-api
