API Key

How to get an API key

To generate an API key, click on the user icon in the top right corner of Glassnode Studio. In the personal settings drop-down, you'll find the API option.

Please note that API access is only available with the Professional plan. If you're not on the Professional plan, please contact our institutional team to upgrade. For a detailed overview of the metrics included in your plan, please refer to our metrics catalogue and the pricing page.

Usage

Specify the api_key query parameter or X-Api-Key header with your API key with all endpoints.

Example using cURL

export API_KEY=YOUR-KEY

# using query parameter
curl "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc&api_key=$API_KEY"

# using request header
curl -H "X-Api-Key:${API_KEY}" "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc"

Example using http

export API_KEY=YOUR-KEY

# using query parameter
http "https://api.glassnode.com/v1/metrics/assets" api_key==$API_KEY

# using request header
http "https://api.glassnode.com/v1/metrics/assets" "X-Api-Key:${API_KEY}"

Example using Python

import json
import requests
import pandas as pd


# insert your API key here
API_KEY = ''

# make API request
res = requests.get('https://api.glassnode.com/v1/metrics/indicators/sopr',
    params={'a': 'BTC', 'api_key': API_KEY})

# convert to pandas dataframe
df = pd.read_json(res.text, convert_dates=['t'])

Last updated