GET/api/v1/onchain/{metric}
Fetch on-chain metric data for a specific blockchain.
Fetches time-series on-chain data for a specific metric and blockchain. Returns daily data points with the metric's fields as described by the status endpoint.
#Authentication
Requires an API key with an active Pro subscription and onchain permission.
x-api-key: YOUR_API_KEY#URL Parameters
| Parameter | Type | Description |
|---|---|---|
metric | string | The metric ID from the status endpoint (e.g., mvrv, nupl, sopr) |
#Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
chain | string | bitcoin | Blockchain to query. Options: bitcoin, ethereum, cardano, dogecoin, litecoin, chainlink |
days | number | all | Return only the last N days of data |
startDate | string | none | Start of date range, inclusive (YYYY-MM-DD) |
endDate | string | none | End of date range, inclusive (YYYY-MM-DD) |
limit | number | none | Maximum number of data points to return (max 10,000) |
fields | string | all | Comma-separated list of field names to include |
format | string | json | Response format: json or csv |
#Request
curl -H "x-api-key: YOUR_API_KEY" \
"https://chartinspect.com/api/v1/onchain/mvrv?chain=bitcoin&days=7"#JSON Response
{
"success": true,
"metric": "mvrv",
"chain": "bitcoin",
"count": 3,
"data": [
{
"date": "2026-03-29",
"btc_price": 68228.04,
"market_cap_usd": 1365226081164.11,
"realized_cap_usd": 1084054568275.03,
"mvrv_ratio": 1.2594,
"timestamp": 1774915200000,
"formattedDate": "2026-03-29"
}
],
"metadata": {
"processingTime": 45,
"timestamp": "2026-03-31T12:00:00.000Z",
"tier": "pro",
"dataUpdateInterval": "10 minutes",
"fields": ["date", "btc_price", "market_cap_usd", "realized_cap_usd", "mvrv_ratio"],
"apiVersion": "v1"
}
}#Filtering Fields
Use the fields parameter to request only specific columns. The timestamp field is always included.
curl -H "x-api-key: YOUR_API_KEY" \
"https://chartinspect.com/api/v1/onchain/sopr?chain=bitcoin&days=3&fields=sopr,sopr_sma7"{
"success": true,
"metric": "sopr",
"chain": "bitcoin",
"count": 3,
"data": [
{ "date": "2026-03-29", "btc_price": 68228.04, "sopr": 1.012, "timestamp": 1774915200000, "formattedDate": "2026-03-29" },
{ "date": "2026-03-30", "btc_price": 68096.26, "sopr": 1.005, "timestamp": 1775001600000, "formattedDate": "2026-03-30" },
{ "date": "2026-03-31", "btc_price": 68150.00, "sopr": 1.018, "timestamp": 1775088000000, "formattedDate": "2026-03-31" }
]
}#CSV Format
Set format=csv to receive data as comma-separated values.
curl -H "x-api-key: YOUR_API_KEY" \
"https://chartinspect.com/api/v1/onchain/mvrv?chain=bitcoin&days=3&format=csv"date,btc_price,mvrv_ratio,timestamp
2026-03-29,68228.04,1.2594,1774915200000
2026-03-30,68096.26,1.2572,1775001600000
2026-03-31,68150.00,1.2580,1775088000000The response Content-Type is set to text/csv with a Content-Disposition header for easy file downloads.
#Date Range Filtering
Use startDate and endDate to request a specific time window:
curl -H "x-api-key: YOUR_API_KEY" \
"https://chartinspect.com/api/v1/onchain/nupl?chain=bitcoin&startDate=2025-01-01&endDate=2025-03-31"Both parameters are inclusive. You can use them individually or together. When combined with days, the days parameter takes precedence.
#Metric Aliases and Partial Matching
The API supports metric aliases for common alternative names. For example, detailed-mvrv resolves to mvrv, and asopr resolves to sopr. See the status endpoint for the full alias table.
If an exact match is not found, the API attempts a partial match against available metric IDs. For example, requesting sell-side may resolve to sell-side-risk if it is the only matching metric.
#Error Responses
| Status Code | Error | Description |
|---|---|---|
400 | Bad Request | Invalid query parameters, unsupported chain, or malformed date format |
403 | Forbidden | Missing or invalid API key, or subscription does not include onchain access |
404 | Not Found | The requested metric does not exist for the specified chain |
500 | Internal Server Error | Unexpected server error. Try again later or contact support |
#Example Error Response
{
"success": false,
"error": "Metric 'invalid-metric' not found for chain 'bitcoin'. Use /api/v1/onchain/status to see available metrics."
}#Notes
- All timestamps are in UTC and represent the start of the daily period.
- The
closefield represents the asset's closing price in USD for that day. - Data is updated daily, typically within a few hours of UTC midnight.
- The maximum value for
limitis 10,000 data points per request. For larger datasets, usestartDateandendDateto paginate through the data.