Skip to main content
Loading market data…
GET/api/v1/on-chain/{asset}/metric/{metric}Hobbyist tier+ · 30 req/min

Edge-cacheable variant of /on-chain/{asset} series mode — metric in the path.

The 'ergonomic' variant of `/api/v1/on-chain/{asset}?metric=…`. Putting the metric in the path makes this trivially cacheable at the edge (no varying query string to normalise) and yields a cleaner URL for doc / changelog embedding. Body shape is 1:1 with the query-based route's series-mode response. Empty series is a valid 200 for a metric we haven't ingested for this asset.

Path parameters

Segments of the URL path, validated server-side.

NameTypeRequiredDefaultDescription
assetstringrequired
Short alphabetic asset code.
metricstringrequired
CoinMetrics metric name (e.g. `CapMrktCurUSD`, `NVTAdj`, `AdrActCnt`, `HashRate`). Case-sensitive.

Query parameters

All query parameters are optional unless marked required.

NameTypeRequiredDefaultDescription
daysnumberoptional365
History window. Max 730.

Response shape

Always wrapped in the standard envelope. Nullable fields are explicitly marked — treat missing numeric data as a real data-source gap, not as an error.

data payloadtypescript
// Wrapped in the standard envelope:
// {
//   data: /* shape below */,
//   meta?: { total?: number; limit?: number; offset?: number; ... }
// }

{
  asset: string;
  metric: string;
  days: number;
  points: Array<{ ts: number; value: number }>;
}

Example

Copy the curl, replace YOUR_KEY with a real key from your dashboard, and run.

Requestbash
curl -sS "http://localhost:3000/api/v1/on-chain/BTC/metric/CapMrktCurUSD?days=90"
Responsejson
{
  "data": {
    "asset": "BTC",
    "metric": "CapMrktCurUSD",
    "days": 90,
    "points": [ { "ts": 1737849600000, "value": 1240000000000 } ]
  },
  "meta": { "total": 1, "days": 90 }
}

Next

Check the error code reference, or get an API key to try the request against your own account.