Source: https://databento.com/docs/api-historical/client/historical


### Historical

To access Databento's historical API, first create an instance of the
`Historical` client. The entire API is exposed through instance methods of
the client.

Note that the API key can be passed as a parameter, which is
[not recommended for production applications](https://databento.com/docs/portal/api-keys.md#securing-your-api-keys).
Instead, you can leave out this parameter to pass your API key via the `DATABENTO_API_KEY` environment variable:

Currently, only `BO1` is supported for historical data.

#### API method

```python
class Historical(
    key: str | None = None,
    gateway: HistoricalGateway | str = HistoricalGateway.BO1,
)
```

#### Example usage

```python
import databento as db

# Pass as parameter
client = db.Historical("$YOUR_API_KEY")

# Or, pass as `DATABENTO_API_KEY` environment variable
client = db.Historical()
```
#### Parameters

| Parameter | Type | Required | Description |
| `key` | str | optional | 32-character API key. Found on your [API keys]($PLATFORM_HOSTNAME/portal/keys) page. If `None` then `DATABENTO_API_KEY` environment variable is used. |
| `gateway` | HistoricalGateway or str | optional | Site of historical gateway to connect to. Currently only `BO1` is supported. If `None` then will connect to the default historical gateway. |
