Available languages: [Python](https://databento.com/docs/api-reference-data/basics/authentication.python.md) · [Rust](https://databento.com/docs/api-reference-data/basics/authentication.rust.md) · [HTTP](https://databento.com/docs/api-reference-data/basics/authentication.http.md)

Source: https://databento.com/docs/api-reference-data/basics/authentication


### Authentication

Databento uses API keys to authenticate requests. You can view and manage
your keys on the [API keys]($PLATFORM_HOSTNAME/portal/keys) page of your portal.

Each API key is a 32-character string starting with `db-`. By default, our library uses the
environment variable `DATABENTO_API_KEY` as your API key. However, if you
pass an API key to the `Reference` constructor through the `key` parameter,
then this value will be used instead.

Related: [Securing your API keys](https://databento.com/docs/portal/api-keys.md#securing-your-api-keys).

#### Example usage

```python
import databento as db

# Establish connection and authenticate
client = db.Reference("$YOUR_API_KEY")

# Authenticated request
print(client.security_master.get_last(symbols="AAPL"))
```
