Authentication — API Reference

DatabentoAPI.load_api_key — Function
load_api_key([explicit])

Resolve the Databento API key. Order of precedence:

  1. explicit argument if non-nothing and non-empty.
  2. ~/.databento/config.toml [auth] api_key = "...".
  3. Environment variable DATABENTO_API_KEY.

Throws BentoAuthError if no key is found.

source
DatabentoAPI.default_config_path — Function
default_config_path()

Cross-platform path to the Databento config file: ~/.databento/config.toml. The environment variable DATABENTO_CONFIG_PATH overrides this — useful for tests and for users with non-standard config locations.

source