API Key

How to get an API key

In order to obtain a key for our API head to Glassnode Studio and register for an account. You will be able to generate a key under API in the user menu.
Access to the API is dependent the plan you are on. For a detailed overview of all metrics you can access with 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

1
export API_KEY=YOUR-KEY
2
3
# using query parameter
4
curl "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc&api_key=$API_KEY"
5
6
# using request header
7
curl -H "X-Api-Key:${API_KEY}" "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc"
Copied!

Example using http

1
export API_KEY=YOUR-KEY
2
3
# using query parameter
4
http "https://api.glassnode.com/v1/metrics/assets" api_key==$API_KEY
5
6
# using request header
7
http "https://api.glassnode.com/v1/metrics/assets" "X-Api-Key:${API_KEY}"
Copied!

Example using Python

1
import json
2
import requests
3
import pandas as pd
4
5
6
# insert your API key here
7
API_KEY = ''
8
9
# make API request
10
res = requests.get('https://api.glassnode.com/v1/metrics/indicators/sopr',
11
params={'a': 'BTC', 'api_key': API_KEY})
12
13
# convert to pandas dataframe
14
df = pd.read_json(res.text, convert_dates=['t'])
Copied!
Last modified 2mo ago