Client

Reference

To access Databento's reference API, first create an instance of the Reference 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. Instead, you can leave out this parameter to pass your API key via the DATABENTO_API_KEY environment variable:

Currently, only the 'bo1' gateway is supported for historical data.

Parameters

Parameter
Type
Required
Description
key
str
optional
32-character API key. Found on your API keys page. If None then DATABENTO_API_KEY environment variable is used.
gateway
databento.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.
API method
1
2
3
4
class Reference(
    key: str | None = None,
    gateway: HistoricalGateway | str = 'bo1',
)
Example usage
1
2
3
4
5
6
7
import databento as db

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

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