> For the complete documentation index, see [llms.txt](https://docs.glassnode.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glassnode.com/basic-api/api.md).

# API Setup

Welcome to the Glassnode API, which powers all our tools, including Glassnode Studio, the CLI, the MCP Server and the Excel add-in. The Glassnode API is available to **Professional subscribers**, with full access to the metrics, history, and resolutions included in your plan. **Advanced** subscribers have access to the more limited [Light API](#light-api). Please be aware that making API requests consumes [data credits](/basic-api/api-credits.md) associated with your subscription tier.

Before making your first request, it is highly recommended that you familiarize yourself with how our data is structured and processed. Understanding these core concepts is crucial for accurate analysis:

* [**Timestamps & Resolutions**](https://docs.glassnode.com/data/timestamps-and-resolutions)**:** Understand how we treat timestamps across different timeframes and metric resolutions.
* [**Data Availability**](https://docs.glassnode.com/data/data-availability)**:** Learn exactly when new data points arrive and are ready to be fetched.
* [**Data Finalization**](https://docs.glassnode.com/data/data-finalization)**:** Read about how we handle data mutations, reprocessing, and finalization over time.
* [**Metadata**](/basic-api/metadata.md)**:** Retrieve metadata for metrics (parameters, time ranges, descriptions, …) and assets (smart contract addresses, external vendor identifiers, …).
* [**Bulk Endpoints**](https://docs.glassnode.com/basic-api/bulk-metrics)**:** Batch multiple queries into a single request.

***

## Light API

The Light API is the API available to **Advanced** subscribers. It's a more limited entry point built for automated and agentic workflows. Compared to the full Professional API, it:

* is limited to 14 days of history,
* is restricted to daily (`1d`) resolution,
* is capped at 50 calls per day, and
* does not support [bulk endpoints](https://docs.glassnode.com/basic-api/bulk-metrics).

***

## Make Your First API Request

### Generate your API key

You 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). Scroll to the bottom to find the *Generate API Key* section.

Follow the instructions on the [API Key](broken://pages/-LiHusL80xkcU11V7R0I) page to generate your credentials and make your first request.

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

### Pro-Tip: The Glassnode CLI

While the API is perfect for programmatic integrations, for ad hoc research, we highly recommend using the [**Glassnode CLI**.](/integrations-and-tools/glassnode-cli.md) The CLI makes it incredibly easy to download metric files directly to your local disk. Because of its command-line nature, it also fits perfectly into **agentic workflows**, allowing AI agents and automated scripts to fetch exactly what they need with minimal overhead.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
