The official Python client library for Glassnode's API – https://docs.glassnode.com
You can get your API from your Glassnode account.
You can add your API key your environment variables by running:
export GLASSNODE_API_KEY=<YOUR-KEY>
You can also add your API key from within the glassnode API python client.
api options can now be called with api_items and indexes can be passed to get method as url parameter
Instantiate the Glassnode client:
from glassnode import GlassnodeClient
gn = GlassnodeClient(api_key='YOUR-KEY')
If you added the API key to your environment variables you can leave the api_key
argument empty.
To fetch a metric run the client's get
method:
sopr = gn.get(
'https://api.glassnode.com/v1/metrics/indicators/sopr',
a='BTC',
s='2020-01-01',
i='24h'
)
For a complete list of all available metric endpoints endpoints and query parameters please visit docs.glassnode.com.