> ## 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

> Authenticate requests with a Bearer token or an api_key query parameter.

Each API request requires authentication to identify the member. Authentication is provided
through an access token. The token is unique, issued for each client.

You can authenticate in one of two ways.

## Access token (recommended)

Include the `Authorization` HTTP header with `Bearer <YOUR_API_KEY>` in every request.

```http theme={null}
GET /v1/{PATH} HTTP/1.1
Host: api.cryptoquant.com
Authorization: Bearer <YOUR_API_KEY>
```

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {"Authorization": "Bearer " + API_KEY}
  response = requests.get(URL, headers=headers)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(URL, {
    headers: { Authorization: `Bearer ${API_KEY}` },
  });
  ```
</CodeGroup>

## Query parameter

Alternatively, pass your key as the `api_key` query parameter.

```http theme={null}
GET /v1/{PATH}?api_key={API_KEY} HTTP/1.1
Host: api.cryptoquant.com
```

<CodeGroup>
  ```python Python theme={null}
  import requests

  response = requests.get(URL, params={"api_key": API_KEY})
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`${URL}?api_key=${API_KEY}`);
  ```
</CodeGroup>

<Warning>
  Prefer the `Authorization` header over the query parameter — URLs are often logged by
  proxies and analytics, which can leak keys passed as query parameters.
</Warning>
