/api/v1/on-chain/{asset}Hobbyist tier+ · 30 req/minCoinMetrics-sourced network metrics — realized cap, active addresses, NVT, MVRV, and more.
When `metric` is omitted you get a summary row for every metric we've ingested for this asset — the latest timestamp, latest value, and source. Pass a specific `metric` and you get a daily time series. Use summary mode on a dashboard to populate many small widgets with one HTTP call; use series mode to chart one metric deeply.
Path parameters
Segments of the URL path, validated server-side.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| asset | string | required | — | Short alphabetic asset code. 2–8 letters, uppercase on the wire. |
Query parameters
All query parameters are optional unless marked required.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| metric | string | optional | — | Metric key (e.g. `realized_cap`, `active_addresses`). Omit for a summary of all metrics. |
| days | number | optional | 365 | History window for series mode. Max 730 (2 years). Ignored in summary mode. |
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.
// Wrapped in the standard envelope:
// {
// data: /* shape below */,
// meta?: { total?: number; limit?: number; offset?: number; ... }
// }
// Summary mode (no metric):
{
asset: string;
metrics: Array<{
metricName: string;
latestTs: number;
latestValue: number | null;
source: string | null;
}>;
}
// Series mode (metric supplied):
{
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.
curl -sS "http://localhost:3000/api/v1/on-chain/BTC?metric=realized_cap&days=180" \
-H "Authorization: Bearer cg_live_YOUR_KEY"{
"data": {
"asset": "BTC",
"metric": "realized_cap",
"days": 180,
"points": [
{ "ts": 1728950400000, "value": 580123450000 },
{ "ts": 1729036800000, "value": 581002110000 }
]
},
"meta": { "total": 2, "days": 180 }
}Notes
- Ingest frequency is daily — expect one point per UTC day at most.
- The hard cap on series length (5000 points) only matters for multi-year ranges on very chatty metrics.
Next
Check the error code reference, or get an API key to try the request against your own account.