# Blockchain Data API reference

> Original page: https://docs.blockvectra.com/en/api/data/

## Overview

Use this Blockchain Data API reference to construct REST requests for indexed blocks, transactions, addresses, tokens, NFTs, DEX activity, tokenized stocks and dataset freshness. To choose a dataset and check chain availability, start with the [datasets directory](https://docs.blockvectra.com/en/datasets/); for wallet token balances and transfer history, follow the [wallet assets guide](https://docs.blockvectra.com/en/guides/wallet-assets/).

* **Base URL**: `https://api.blockvectra.com/v1/data` — every route except `/chains` is prefixed with a chain identifier (e.g. `https://api.blockvectra.com/v1/data/{chain}/…`)
* **Protocol**: HTTP `GET` (plus `POST` for batch token lookups at `/{chain}/tokens:batch`), JSON responses
* **Authentication**: API key required — pass your key in the `x-api-key` request header. Requests are metered and billed in Compute Units (CU); only 2xx successful responses are billed
* **Ethereum**: data coverage is determined by `coverage.from_block` in `GET /v1/data/chains`, and covers a smaller set of datasets — see [Supported Chains → Ethereum](https://docs.blockvectra.com/en/chains/#ethereum)
* [TypeScript SDK (GitHub)](https://github.com/blockvectra/data-api-js#installation) · [Daily DEX price example](https://github.com/blockvectra/data-api-js/blob/fcf80e2b3d72e168ba9ffddf5eae89e5ee7e269c/README.md#daily-dex-prices) · [npm](https://www.npmjs.com/package/@blockvectra/data-api) · [WETH/USDG · robinhood\_mainnet · 2026-10-01 UTC](https://github.com/blockvectra/data-api-js/blob/0e24d26e9960469445a6fd8b590d1ec41265913f/README.md#historical-wethusdg-response) · [JSON](https://github.com/blockvectra/data-api-js/blob/0e24d26e9960469445a6fd8b590d1ec41265913f/docs/responses/dex-prices-robinhood-weth-usdg-2026-10-01.json)

```bash
npm install @blockvectra/data-api
```

Need cursor-based history? The [checkpointed ERC-20 transfers example](https://github.com/blockvectra/data-api-js/blob/fa40d51e322fe94683b4f184289ce48e39ec825f/README.md#checkpointed-erc-20-transfers-one-page-per-run) saves one page and its original `meta` per run, then resumes from the same opaque cursor when you rerun it with the same fixed query and state file. Pagination exhaustion alone does not prove a complete history — check `coverage` separately. ERC-20 only. [Install the prebuilt package](https://github.com/blockvectra/data-api-js/blob/fa40d51e322fe94683b4f184289ce48e39ec825f/README.md#install-the-prebuilt-package) to run it directly; no local schema generation or source build.

Data API CU weights are listed on the [Pricing](https://blockvectra.com/en/pricing/) page and returned by `GET /v1/plans`. See [Quickstart → Call the Data API](https://docs.blockvectra.com/en/quickstart/#4-call-the-data-api) for example requests and response shapes. For path versioning, backward compatibility rules, and SDK recommendations, see [API versioning and compatibility](https://docs.blockvectra.com/en/api/versioning/).

## Chains

The Data API serves indexed data scoped to each chain: `https://api.blockvectra.com/v1/data/{chain}/…`.

Available datasets and features vary by chain; see [Supported Chains](https://docs.blockvectra.com/en/chains/) for the full capability matrix. `GET https://api.blockvectra.com/v1/data/chains` reports each chain's `features`, `coverage`, `finality` and `limits`. Requests outside a dataset's coverage return HTTP `422 no_coverage` (not billed); an unknown or not-public chain returns HTTP `404` with `error.code` `not_found` (not billed; chain names must be exact lowercase slugs).

## Errors

Every error response is `{"error":{"code","message"}}`; only `409 not_indexed_yet` may add `indexed_through` (the highest indexed block on that chain), and it is absent when the chain has no indexed data yet. Codes customers hit most often:

| Status | `error.code`           | Meaning                                                                                                                                                                                      | Action                                                                                                                                                                                         |
| ------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `402`  | `insufficient_balance` | Paid balance or free grant exhausted; when balance is known, `error.data` includes `balance_units` and `balance_cu` (not billed)                                                             | Top up on-chain on the console [Billing page](https://console.blockvectra.com/billing/), or wait for the free allowance to refill                                                              |
| `404`  | `not_found`            | Unknown or not-public `{chain}`, or the object does not exist                                                                                                                                | Fix the request                                                                                                                                                                                |
| `409`  | `not_indexed_yet`      | Request reaches above `as_of_block` (newest fully written block; includes `indexed_through`), hash resolves above `as_of_block`, or the chain has no indexed data yet (no `indexed_through`) | With `indexed_through`, poll until your block or `to_block` is at or below it; without it, wait for the chain to start indexing (`coverage.has_data` in `GET /v1/data/chains` shows the state) |
| `422`  | `no_coverage`          | Permanent gap: the chain lacks that capability, or the block is before indexed/trace coverage                                                                                                | Change the request; retrying will not help                                                                                                                                                     |
| `429`  | `rate_limited`         | Key CU rate limit (response includes `Retry-After`) or account call rate limit (no `Retry-After`); not billed                                                                                | Retry after `Retry-After` seconds                                                                                                                                                              |
| `429`  | `cost_exceeds_burst`   | A single request costs more than the key's burst capacity; no `Retry-After` (not billed)                                                                                                     | Split the request; retrying as sent never succeeds                                                                                                                                             |
| `503`  | `unavailable`          | Temporarily unavailable; the response carries `Retry-After`. Also returned for historical requests on a chain whose `coverage.from_block` is currently `null`                                | Retry after `Retry-After` seconds                                                                                                                                                              |
| `503`  | `gateway_overloaded`   | Account concurrency limit across all its keys and chains is reached, or the service is temporarily busy; `Retry-After: 1` (not billed)                                                       | Reduce concurrent requests across the account and wait `Retry-After` seconds before retrying                                                                                                   |

## Endpoint index

### Chain

- GET /chains — List supported chains
- GET /{chain}/blocks/{number} — Get a block by number
- GET /{chain}/blocks/hash/{hash} — Get a block by hash
- GET /{chain}/blocks/{number}/transactions — List a block's transactions
- GET /{chain}/transactions/{hash} — Get a transaction by hash

### Status

- GET /{chain}/status/freshness — Freshness and lag per dataset

### Addresses

- GET /{chain}/addresses/{address}/transactions — List an address's transactions
- GET /{chain}/addresses/{address}/transfers — List an address's token transfers
- GET /{chain}/addresses/{address}/balances — List an address's ERC-20 balances

### Tokens

- GET /{chain}/tokens/{token}/transfers — List a token contract's transfers
- GET /{chain}/tokens/{token}/holders — List a token's holders
- GET /{chain}/tokens/{token} — Get token metadata
- POST /{chain}/tokens:batch — Batch get token metadata

### NFTs

- GET /{chain}/nfts/{contract}/{token_id} — Get one NFT's owner/holders
- GET /{chain}/nfts — List NFTs owned by an address

### DEX

- GET /{chain}/dex/swaps — List DEX swaps by pool or token
- GET /{chain}/dex/prices — Daily DEX token prices

### Stocks

- GET /{chain}/stocks — Daily leaderboard of tokenized stocks
- GET /{chain}/stocks/{token} — Get one tokenized stock

### Traces

- GET /{chain}/blocks/{number}/traces — Historical callTracer trace tree for a whole block
- GET /{chain}/transactions/{hash}/trace — Historical callTracer trace tree for one transaction
