> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cryptoquant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Keyed Sentiment Data endpoints read the API key from the X-API-Key header or the api_key query parameter.

Keyed endpoints read the API key from one of these two places:

<Tabs>
  <Tab title="Header (Recommended)">
    ```http theme={null}
    GET /api/v1/consensus?asset=BTC&days=365 HTTP/1.1
    Host: consensus.cryptoquant.com
    X-API-Key: <YOUR_API_KEY>
    ```
  </Tab>

  <Tab title="Query parameter">
    ```text theme={null}
    https://consensus.cryptoquant.com/api/v1/consensus?asset=BTC&days=365&api_key=<YOUR_API_KEY>
    ```

    Avoid this form in logged URLs.
  </Tab>
</Tabs>

<Warning>
  `Authorization: Bearer` is **not** read by this API. The CryptoQuant [Data API](/guides/authentication)
  and the [Alpha Indicator API](/indicator-api/authentication) use a Bearer token; the Analyst
  Consensus API uses the two forms above. Keys start with `unbias_live_`.
</Warning>

## Which endpoints need a key

The public endpoints need no key at all:

* [`/assets`](/sentiment/assets)
* [`/consensus`](/sentiment/consensus-index) without `days` (the latest point)
* [`/analyst-views`](/sentiment/analyst-views) and [`/calls`](/sentiment/calls)
* [`/analysts/top`](/sentiment/top-analysts) and [`/analysts/{handle}`](/sentiment/analyst-track-record)

A key unlocks the index history (`/consensus` with `days`), the per-asset breakdown
(`/consensus/breakdown`) and — on the Premium and Enterprise plans — the per-analyst stance
series (`/sentiment`). What each plan can read is on [Plans & Access](/sentiment/plans-and-access).

## Getting a key

Keys are provisioned with the CryptoQuant **Premium** plan or an **Enterprise** agreement; there is
no self-serve key endpoint on this host.

* **Premium** — subscribe on the [CryptoQuant pricing page](https://cryptoquant.com/pricing) and
  use the API as part of your subscription.
* **Enterprise** — [contact us](https://cryptoquant.com/contact-us) to discuss your use case.

<Note>
  **Relationship to your CryptoQuant API key.** The Analyst Consensus API key is a separate
  credential from the key you use on `api.cryptoquant.com` — it carries its own plan (separate from
  your site login) and is sent as `X-API-Key`. The CryptoQuant API key is **not** accepted on
  `consensus.cryptoquant.com` today. If you only need the daily Analyst Consensus Index for BTC, ETH
  or SOL, your CryptoQuant Premium key can read it from the
  [Indicator API](/indicator-api/consensus) with Bearer authentication.
</Note>

## cURL

```bash theme={null}
curl -X GET "https://consensus.cryptoquant.com/api/v1/consensus?asset=BTC&days=365" \
-H "X-API-Key: <YOUR_API_KEY>"
```

## JavaScript

```javascript theme={null}
const response = await fetch(
  "https://consensus.cryptoquant.com/api/v1/consensus?asset=BTC&days=365",
  { headers: { "X-API-Key": "<YOUR_API_KEY>" } }
);
const json = await response.json();
```

## Python

```python theme={null}
import requests

headers = {"X-API-Key": "<YOUR_API_KEY>"}
url = "https://consensus.cryptoquant.com/api/v1/consensus?asset=BTC&days=365"
print(requests.get(url, headers=headers).json())
```

A request without a key on a keyed endpoint answers `401 API_KEY_REQUIRED`; an unknown or inactive
key answers `401 INVALID_API_KEY` — see [Errors](/sentiment/errors).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.