Blockchair API: First Requests and Responses
Blockchair API provides REST access to blockchain records and analytical queries. Getting started means choosing a supported network and endpoint, configuring access, and reading the returned data alongside its response metadata. Dashboard lookups retrieve known records, while SQL-like queries select and summarize collections.
Updated
Which read endpoint fits the task?
Blockchair’s API v.2.0.80 documentation describes several ways to retrieve data. Endpoint availability and fields depend on the blockchain, so check the specific route and historical coverage that the application needs.
| Endpoint family | Data and intended use |
|---|---|
| Statistics | Network summaries for an overview of blockchain activity. Available metrics depend on the chain. |
| Dashboards | Structured lookups of known blocks, transactions, or addresses using the appropriate identifier. |
| Raw endpoints | Record data obtained directly from Blockchair’s nodes for access to the underlying node representation. |
| Infinitables | Collections of database rows that support filtering, sorting, and aggregation through the options available for the selected table. |
How is access configured?
Blockchair offers limited trial access and Premium plans. Under the v.2.0.80 policy, occasional personal or test use and non-commercial or academic projects can use up to 1 440 request points per day without a key. The free plan also has a limit of 30 requests per minute, and the daily counter resets at 00:00 UTC. Higher daily usage requires a Premium API key.
The v.2.0.80 policy requires a Premium API key for commercial projects regardless of volume. Pass credentials in the
key
query parameter, and keep them behind a server-side proxy in public web applications.
How is a first read request formed?
Read requests generally use HTTPS GET; mass address-balance checks also support POST. Configure the provider’s API base address in your HTTP client; the documented method and API-relative path for Bitcoin block height
0
are:
GET /bitcoin/dashboards/block/0
The
bitcoin
segment selects the network, and
0
selects a block within that network. Credentials and documented options follow
?
; separate additional parameters with
&
.
What does the response contain?
JSON responses normally separate the requested content in
data
from request metadata in
context
. A dashboard structures its content around the requested entity; an infinitable returns database rows.
- Request status
-
context.codereports the response status. A successful request uses200; an error may include an explanation incontext.error. Check the returned content and match count before treating a lookup as complete; for the block-height-0 example, context.results should be 1 and data["0"]["block"]["id"] should be 0. - Result counts and pagination
-
Where present,
context.resultsreports found records. Infinitables usecontext.rowsfor returned rows andcontext.total_rowsfor all matching rows. Applied pagination appears incontext.limitandcontext.offset. Not every endpoint returns every metadata field. - Cache and chain state
- In the response context, the cache object’s live flag is false for a cached response and true otherwise. The cache object’s until field gives its expiry. Where returned, the context’s state field identifies the API’s latest known block height for the selected chain. Cache expiry and chain height describe different aspects of freshness.
- API version
-
context.api.versionidentifies the API version. Version notices and scheduled major updates provide context for compatibility changes.
Some endpoints also offer CSV or TSV output. Those formats return plain data without the JSON metadata, so the response parser must match the requested format.
Which values depend on the network?
Bitcoin address dashboards in v.2.0.80 express
balance
in satoshis and include unconfirmed outputs unless
?state=latest
is used. That option restricts the Bitcoin dashboard balance, transaction list, and UTXO list to confirmed data.
The
Ethereum address dashboard
expresses its native
balance
in wei and returns that value as a string because it can exceed ordinary integer ranges. ERC-20 token balances have their own smallest denomination, and
token_decimals
determines how the integer balance converts into token units. Preserve these units and numeric strings during parsing before converting amounts for display.
How do collection queries and page limits relate?
SQL-like queries use
q
for filtering,
s
for sorting, and
a
for aggregation. The selected table determines the available fields.
limit
caps the returned page, while
offset
skips rows within the result set; neither changes the filter itself.
Bitcoin transaction collections separate blockchain records at
/bitcoin/transactions
from pending records at
/bitcoin/mempool/transactions
. Dashboard transaction lookups search both the blockchain and the mempool.
Dashboard options have their own meanings. A Bitcoin address dashboard can limit its recent transaction list and UTXO list separately, so collection-query pagination should not be assumed to apply identically to a dashboard.
How is request usage counted?
Request points measure API usage. A single HTTP call can consume more than one point when its endpoint or options require additional work. The documented base cost applies to default result limits without extra options; requesting additional token data or increasing result limits can increase the cost. Use the endpoint’s cost formula and returned
context.request_cost
when estimating usage.
For large historical extracts, Blockchair also documents downloadable TSV database dumps that can be loaded into a local database. These provide an alternative to repeatedly paging through the API.
When should a failed request be retried?
400
calls for checking
context.error
and correcting the request. Limit errors such as
402
or
429
require reviewing frequency, request cost, and quota.
For a server error such as
500
or
503
, the documentation allows waiting before retrying the same request. However,
503
can also mean temporary IP blocking, so inspect the error context before retrying.