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

ParameterTypeDescription
metricstringThe metric ID from the status endpoint (e.g., mvrv, nupl, sopr)

#Query Parameters

ParameterTypeDefaultDescription
chainstringbitcoinBlockchain to query. Options: bitcoin, ethereum, cardano, dogecoin, litecoin, chainlink
daysnumberallReturn only the last N days of data
startDatestringnoneStart of date range, inclusive (YYYY-MM-DD)
endDatestringnoneEnd of date range, inclusive (YYYY-MM-DD)
limitnumbernoneMaximum number of data points to return (max 10,000)
fieldsstringallComma-separated list of field names to include
formatstringjsonResponse 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

json
{
  "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"
json
{
  "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,1775088000000

The 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 CodeErrorDescription
400Bad RequestInvalid query parameters, unsupported chain, or malformed date format
403ForbiddenMissing or invalid API key, or subscription does not include onchain access
404Not FoundThe requested metric does not exist for the specified chain
500Internal Server ErrorUnexpected server error. Try again later or contact support

#Example Error Response

json
{
  "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 close field 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 limit is 10,000 data points per request. For larger datasets, use startDate and endDate to paginate through the data.
Was this page helpful?