# Crypto Data API - Coin Metrics On-Chain Metrics and Market Data (`nabeelbaghoor/crypto-onchain-market-data-api`) Actor

Crypto data API for Coin Metrics: on-chain network metrics (active addresses, fees, supply, market cap, MVRV), reference rates, pair and market candles, trades, funding rates, open interest, liquidations and indexes. Free Community data with no key, or bring your own Pro key.

- **URL**: https://apify.com/nabeelbaghoor/crypto-onchain-market-data-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Automation
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 metrics observation or index level returned (pro key)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Crypto Data API - Coin Metrics On-Chain Metrics and Market Data

Export Coin Metrics crypto data into an Apify dataset: on-chain network metrics, reference rates and pair candles for free with no key, plus exchange candles, trades, funding rates, open interest, liquidations, quotes and index levels with your own Coin Metrics Pro API key.

This actor wraps the Coin Metrics API v4 (Coin Metrics is now part of Talos). It turns a list of assets, markets, pairs, indexes or exchanges into clean, deduplicated rows you can download as JSON, CSV or Excel, schedule on a timer, or feed into research notebooks, dashboards, spreadsheets and data warehouses.

### What it does

- **On-chain network data (free)**: thousands of asset metrics for Bitcoin, Ethereum and hundreds of other assets: active addresses (`AdrActCnt`), transaction count (`TxCnt`), adjusted transfer value (`TxTfrValAdjUSD`), fees (`FeeTotUSD`), hash rate (`HashRate`), current supply (`SplyCur`), market cap (`CapMrktCurUSD`), MVRV (`CapMVRVCur`), exchange flows (`FlowInExUSD`), price (`PriceUSD`) and Coin Metrics reference rates (`ReferenceRateUSD`). One row per asset and day, one column per metric.
- **Pair candles (free)**: cross-exchange open, high, low and close for asset pairs such as `btc-usd`, from 1 minute to 1 day.
- **Market candles (Pro)**: OHLCV, VWAP, USD volume and trade count per exchange market, such as `coinbase-btc-usd-spot` or `binance-BTCUSDT-future`.
- **Market trades (Pro)**: tick-level trades with price, amount, side and Coin Metrics trade ID.
- **Derivatives (Pro)**: perpetual funding rates, futures and options open interest (contracts and USD value), and liquidations.
- **Market quotes (Pro)**: best bid and ask with sizes, raw or one snapshot per minute, hour or day.
- **Index levels (Pro)**: Coin Metrics Bletchley Indexes (CMBI) such as `CMBIBTC` and `CMBI10`, and the other indexes Coin Metrics calculates.
- **Exchange metrics (Pro)**: reported spot volume, futures open interest and more per exchange.
- **Coverage and reference data (free)**: which metrics and frequencies your tier can read and over what dates, every metric definition with unit and description, and every asset, exchange, market and index ID.
- **Latest value for many assets in one run**: set latest rows per entity to 1 and the run returns the most recent value for every asset or market listed.
- **Pay only for Pro results**: rows from the free Community API are never charged, and a request the provider has nothing for becomes a free row that says why.

### Input

| Field | Used by | What it does |
| --- | --- | --- |
| `mode` | all | `assetMetrics` (default), `pairCandles`, `marketCandles`, `marketTrades`, `marketFundingRates`, `marketOpenInterest`, `marketLiquidations`, `marketQuotes`, `indexLevels`, `exchangeMetrics`, `assetMetricCatalog`, `metricDefinitions`, `assets`, `exchanges`, `markets` or `indexes` |
| `assets` | asset metrics, coverage | `btc`, `eth`, `sol`, or `*` for all |
| `metrics` | asset metrics, exchange metrics, coverage | `PriceUSD`, `AdrActCnt`, `volume_reported_spot_usd_1d` |
| `markets` | market modes | `coinbase-btc-usd-spot`, `binance-BTCUSDT-future`, patterns such as `coinbase-*-spot` |
| `pairs` | pair candles | `btc-usd`, `eth-usd` |
| `indexes` | index levels | `CMBIBTC`, `CMBI10` |
| `exchanges` | exchange metrics | `coinbase`, `binance` |
| `frequency` | asset metrics, candles, index levels, exchange metrics | `1d` (default), `1h`, `1m`, `1b` (block by block) and others the mode documents |
| `granularity` | open interest, quotes | `raw` (default), `1m`, `1h`, `1d` |
| `startTime`, `endTime` | time series modes | `YYYY-MM-DD` or a UTC time; both ends inclusive |
| `sortOrder` | time series modes | Newest first (default) or oldest first |
| `limitPerEntity` | time series modes | Latest (or earliest) rows per asset, market, pair, index or exchange |
| `exchange`, `marketType`, `baseAsset`, `quoteAsset` | markets | Filters for the market list |
| `maxResults` | all | Row cap for the whole run (default 500) |
| `requestsPerMinute` | all | Pacing (default 90, inside the Community limit) |
| `apiKey` | Pro modes | Optional. Your Coin Metrics Pro API key, stored as a secret |

### Free Community tier or your own Pro key

Without a key, the actor reads the free Coin Metrics Community API: daily network data for most assets, recent reference rates, pair candles, the coverage catalog and all reference data. No sign-up is needed and these rows cost nothing beyond the platform run.

Market candles, trades, funding rates, open interest, liquidations, quotes, index levels, exchange metrics and intraday network data need a Coin Metrics Pro API key. Coin Metrics issues keys with a paid subscription or a trial; ask Coin Metrics (Talos) sales at coinmetrics.io. Paste the key into the API key field or set the `DATA_API_KEY` environment secret. A Pro mode run without a key ends cleanly with a message before any request is sent.

### Example output

```json
{
  "mode": "assetMetrics",
  "modeLabel": "Asset metrics (network and market data)",
  "recordType": "assetMetric",
  "identifier": "btc,eth",
  "found": true,
  "tier": "community",
  "id": "eth|2026-10-07T00:00:00.000000000Z||",
  "entity": "eth",
  "entityType": "asset",
  "metric": "PriceUSD",
  "frequency": "1d",
  "name": null,
  "date": "2026-10-07T00:00:00.000Z",
  "price": 2573.13488095266,
  "volume": null,
  "value": 2573.13488095266,
  "retrievedAt": "2026-10-10T09:00:00.000Z",
  "note": null,
  "asset": "eth",
  "time": "2026-10-07T00:00:00.000000000Z",
  "AdrActCnt": "755689",
  "CapMrktCurUSD": "314206860506.31481494060233178742040554092",
  "PriceUSD": "2573.13488095266",
  "TxCnt": "1963594"
}
```

Metric values stay the exact decimal strings Coin Metrics sends; the `value` and `price` columns repeat them as numbers for sorting and charts.

### FAQ

#### What is the Coin Metrics API?

Coin Metrics is a crypto financial intelligence provider, acquired by Talos in July 2025. Its API v4 serves Network Data Pro (on-chain metrics computed from full nodes), Market Data Feed (trades, candles, order books, quotes and derivatives data from spot and derivatives exchanges), Coin Metrics reference rates and CMBI indexes, and reference data. It is documented publicly at docs.coinmetrics.io. This actor wraps its most used read endpoints; the docs and the live hosts were checked on 2026-10-10.

#### Can I use it without an API key?

Yes. With the API key field empty, the asset metrics, pair candles, coverage, metric definitions, assets, exchanges, markets and indexes modes read the free Community API. Run the coverage mode to see which metrics and frequencies the free tier serves for an asset, and from what date.

#### How do I download Bitcoin on-chain data such as active addresses and MVRV?

Pick asset metrics, list `btc` in assets, list `AdrActCnt`, `CapMVRVCur`, `TxCnt` or any other metric IDs in metrics, set the frequency to `1d` and the start and end dates, and run. Each row is one day with one column per metric.

#### Where do I find metric IDs and market IDs?

Run the metric definitions mode for every asset metric with its full name, unit, category and docs link, and the markets mode (filter by exchange, type, base and quote) for every market ID. Spot market IDs read `exchange-base-quote-spot`, such as `coinbase-btc-usd-spot`.

#### How do I get the latest value for many assets at once?

Set latest rows per entity to 1 and keep newest first. Use `*` in assets to read every asset that carries the metrics you list.

#### Why did my run say the data is not on my plan?

Coin Metrics licenses data per dataset, frequency and time range. The Community API answers market data, indexes, exchange metrics and intraday network data with HTTP 403, and so does a Pro key whose subscription does not include the request. The run ends cleanly with Coin Metrics' own message and nothing is charged.

#### What do I pay?

Community rows are free. With a Pro key: 0.005 USD per asset metrics row, exchange metrics row, index level, candle, trade, liquidation or reference record, and 0.01 USD per funding rate, open interest snapshot or quote. Requests that find nothing are free. Your Coin Metrics subscription applies separately.

#### What happens if my key is wrong?

Coin Metrics answers HTTP 401 `wrong_credentials` and the run ends cleanly with a status message, before anything is charged. A metric, frequency or market the provider does not support becomes a free row with the provider's own explanation.

### Keyword map

crypto data API, Coin Metrics API, on-chain data API, blockchain data API, Bitcoin network data, Ethereum on-chain metrics, active addresses API, MVRV API, crypto market cap API, crypto reference rate, Bitcoin price history API, crypto OHLC candles, crypto trades API, funding rate API, open interest API, crypto liquidations API, CMBI index, crypto exchange volume, Talos Coin Metrics, crypto coverage catalog.

### Terms and data use

Community data is free under the Creative Commons Attribution-NonCommercial 4.0 licence (CC BY-NC 4.0): credit Coin Metrics and do not use it commercially without a commercial licence from Coin Metrics. The Coin Metrics terms of use also grant use for non-commercial internal business purposes only, prohibit duplicating, publishing, distributing or creating derivative works from the data without written authorisation, prohibit building a product that substitutes for or competes with Coin Metrics, and prohibit using the data to input into, train, improve or generate output from any AI system. Pro data is governed by your separate Coin Metrics subscription agreement, and this actor does not change it. Keep the run's dataset private unless your licence allows sharing it.

Which routes were checked live: both hosts answer an invented path with HTTP 404 `not_found` and a real path with data or an auth answer, so every wired route was confirmed. The Community routes returned real data keyless; the Pro routes were confirmed with an invalid key (HTTP 401 `wrong_credentials`).

# Actor input Schema

## `mode` (type: `string`):

Free without a key (Community API): asset metrics, pair candles, asset metric coverage, metric definitions, assets, exchanges, markets and indexes. Need your own Coin Metrics Pro API key: market candles, trades, funding rates, open interest, liquidations, quotes, index levels and exchange metrics.

## `assets` (type: `array`):

Asset metrics and asset metric coverage. Coin Metrics asset tickers, one per line: btc, eth, sol, usdc. Use \* for every asset (asset metrics only). The assets mode lists every ticker.

## `metrics` (type: `array`):

Asset metrics (required), exchange metrics (required) and asset metric coverage (optional filter). Metric IDs, one per line. Network data: PriceUSD, CapMrktCurUSD, AdrActCnt, TxCnt, TxTfrValAdjUSD, FeeTotUSD, HashRate, SplyCur, CapMVRVCur, FlowInExUSD, ReferenceRateUSD. Exchange metrics: volume_reported_spot_usd_1d, open_interest_reported_future_usd. The metric definitions mode lists every asset metric.

## `markets` (type: `array`):

Market candles, trades, funding rates, open interest, liquidations and quotes. Coin Metrics market IDs, one per line: coinbase-btc-usd-spot, binance-btc-usdt-spot, binance-BTCUSDT-future, deribit-BTC-PERPETUAL-future. Patterns work too: coinbase-\*-spot, \*USDT-future. The markets mode lists every ID.

## `pairs` (type: `array`):

Pair candles. Asset pairs, one per line: btc-usd, eth-usd, sol-usd. Patterns such as btc-\* work too.

## `indexes` (type: `array`):

Index levels. Coin Metrics index tickers, one per line: CMBIBTC, CMBIETH, CMBI10. Patterns such as CMBI\* work too. The indexes mode lists every ticker.

## `exchanges` (type: `array`):

Exchange metrics. Coin Metrics exchange names, one per line: coinbase, binance, kraken, deribit. Use \* for every exchange. The exchanges mode lists every name.

## `frequency` (type: `string`):

Asset metrics: 1d, 1h, 10m, 5m, 1m, 1s, 1b (block by block) or 1d-ny-close. Candles: 1m to 1d. Index levels: 1s, 15s, 1h, 1d, 1d-ny-close or 1d-sg-close. Exchange metrics: 1h or 1d. The free Community tier serves most asset metrics daily only (reference rates also intraday for the last few points).

## `granularity` (type: `string`):

Open interest and quotes. Raw returns every snapshot; 1m, 1h or 1d keeps one real snapshot per interval.

## `startTime` (type: `string`):

Inclusive start of the window, as YYYY-MM-DD or a UTC time such as 2026-01-31T12:00:00Z. Left empty, the window starts at the beginning of the history.

## `endTime` (type: `string`):

Inclusive end of the window, as YYYY-MM-DD or a UTC time. Left empty, the window ends now.

## `sortOrder` (type: `string`):

Newest first keeps the most recent rows when the maximum results cap is reached; oldest first reads the window forward from its start.

## `limitPerEntity` (type: `integer`):

Time series modes. Caps the rows each asset, market, pair, index or exchange contributes. 1 with newest first returns the latest value for every entity in one request.

## `exchange` (type: `string`):

Markets mode. Only markets on this exchange, such as coinbase, binance or deribit.

## `marketType` (type: `string`):

Markets mode. Only spot, future or option markets.

## `baseAsset` (type: `string`):

Markets mode. Only markets with this base asset, such as btc.

## `quoteAsset` (type: `string`):

Markets mode. Only markets with this quote asset, such as usd or usdt.

## `maxResults` (type: `integer`):

The most rows this run returns (and, with a Pro key, charges for). Also the page size, up to the documented 10,000.

## `requestsPerMinute` (type: `integer`):

Pacing. The Community API allows 10 requests per 6 seconds per IP address, Pro keys 6000 per 20 seconds; the actor also waits and retries when the provider answers 429.

## `apiKey` (type: `string`):

Optional. Your own Coin Metrics Pro API key. Left empty, the actor reads the free Coin Metrics Community API, which needs no key. Sent as the documented api_key parameter and never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "assetMetrics",
  "assets": [
    "btc",
    "eth"
  ],
  "metrics": [
    "PriceUSD",
    "CapMrktCurUSD",
    "AdrActCnt",
    "TxCnt"
  ],
  "markets": [
    "coinbase-btc-usd-spot"
  ],
  "pairs": [
    "btc-usd"
  ],
  "indexes": [
    "CMBIBTC"
  ],
  "exchanges": [
    "coinbase"
  ],
  "frequency": "1d",
  "granularity": "raw",
  "sortOrder": "end",
  "marketType": "any",
  "maxResults": 500,
  "requestsPerMinute": 90
}
```

# Actor output Schema

## `records` (type: `string`):

One row per metrics observation, candle, trade, derivatives snapshot, index level, coverage entry, definition or reference record.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "assets": [
        "btc",
        "eth"
    ],
    "metrics": [
        "PriceUSD",
        "CapMrktCurUSD",
        "AdrActCnt",
        "TxCnt"
    ],
    "markets": [
        "coinbase-btc-usd-spot"
    ],
    "pairs": [
        "btc-usd"
    ],
    "indexes": [
        "CMBIBTC"
    ],
    "exchanges": [
        "coinbase"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/crypto-onchain-market-data-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "assets": [
        "btc",
        "eth",
    ],
    "metrics": [
        "PriceUSD",
        "CapMrktCurUSD",
        "AdrActCnt",
        "TxCnt",
    ],
    "markets": ["coinbase-btc-usd-spot"],
    "pairs": ["btc-usd"],
    "indexes": ["CMBIBTC"],
    "exchanges": ["coinbase"],
}

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/crypto-onchain-market-data-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "assets": [
    "btc",
    "eth"
  ],
  "metrics": [
    "PriceUSD",
    "CapMrktCurUSD",
    "AdrActCnt",
    "TxCnt"
  ],
  "markets": [
    "coinbase-btc-usd-spot"
  ],
  "pairs": [
    "btc-usd"
  ],
  "indexes": [
    "CMBIBTC"
  ],
  "exchanges": [
    "coinbase"
  ]
}' |
apify call nabeelbaghoor/crypto-onchain-market-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/crypto-onchain-market-data-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dSIBgPlGzPjjjEVl3/builds/p3tv60uWEVI2H14Qo/openapi.json
