Authentication

How to authenticate with the ChartInspect API using API keys.

The ChartInspect API uses API keys for authentication. Pass your key via the x-api-key header with every request.

#Free vs. Pro Access

CategoryFree TierPro Tier
Crypto pricesYesYes
Economic indicatorsYesYes
On-chain metricsNoYes
Market indicatorsNoYes
Exchange/ETF dataNoYes
Derivatives dataNoYes

A Pro subscription is required to access on-chain, market-indicators, exchange-etf, and derivatives endpoints. Free-tier API keys can access crypto price data and economic indicators.

#Getting an API Key

  1. Sign up at chartinspect.com
  2. Navigate to Settings and generate an API key
  3. Subscribe to a Pro plan on the pricing page to unlock on-chain and market indicator data

#Using Your API Key

Pass your API key in the x-api-key header with every request:

curl -H "x-api-key: YOUR_API_KEY" \
  https://chartinspect.com/api/v1/onchain/mvrv?chain=bitcoin

#Python Example

python
import requests

headers = {"x-api-key": "YOUR_API_KEY"}
response = requests.get(
    "https://chartinspect.com/api/v1/onchain/mvrv",
    params={"chain": "bitcoin", "days": 90},
    headers=headers,
)
data = response.json()
print(f"Latest MVRV: {data['data'][-1]['mvrv']}")

#JavaScript Example

javascript
const response = await fetch(
  "https://chartinspect.com/api/v1/onchain/mvrv?chain=bitcoin&days=90",
  { headers: { "x-api-key": "YOUR_API_KEY" } }
);
const { data } = await response.json();
console.log(`Latest MVRV: ${data.at(-1).mvrv}`);

#Error Responses

StatusMeaning
401Missing or invalid API key
403Insufficient tier or permissions (e.g., free-tier key accessing on-chain data)
429Rate limit exceeded

Example 403 response for a free-tier key attempting to access on-chain data:

json
{
  "success": false,
  "error": "API access for on-chain data requires a Pro subscription.",
  "currentTier": "free",
  "upgradeUrl": "https://chartinspect.com/pricing"
}

Example 401 response for a missing or invalid key:

json
{
  "success": false,
  "error": "Invalid or missing API key."
}

#Security Best Practices

  • Never expose your API key in client-side code or public repositories.
  • Regenerate your key immediately if you suspect it has been compromised.
  • Use environment variables to store your key in application code.
Was this page helpful?