# API Key

## How to get API access

{% hint style="info" %}
Please note that API access is not included in the Professional Plan by default. It is available as an optional add-on that Professional Plan subscribers can purchase. If you would like to explore purchasing the API add-on or upgrading your account, please contact our [Institutional team](https://studio.glassnode.com/pricing?modal=upgrade\&upgradePlan=professional).
{% endhint %}

Once you've upgraded to receive API accessyou can generate an API key by clicking on the user icon in the top right corner of [Glassnode Studio](https://studio.glassnode.com/). In the dropdown, you'll find the [API option](https://studio.glassnode.com/settings/api).

For a detailed overview of the metrics included in your plan, please refer to our [metrics catalogue](https://docs.glassnode.com/data/metric-catalog) and the [pricing page](https://studio.glassnode.com/pricing).

{% embed url="<https://youtu.be/VweV3lo-kCQ>" %}

## Usage

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

#### Example using `cURL`

```bash
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`

```bash
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`

```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'])
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glassnode.com/basic-api/api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
