{"id":6340,"library":"databento","title":"Databento Python Client","description":"The official Python client library for Databento, providing fast, lightweight access to both live and historical market data from multiple venues and asset classes. It supports various schemas like MBO, MBP, OHLCV, and trades, and features an efficient Databento Binary Encoding (DBN) for data storage. The library is actively maintained with frequent releases, currently at version 0.75.0, offering consistent message schemas across live and historical data.","status":"active","version":"0.75.0","language":"en","source_language":"en","source_url":"https://github.com/databento/databento-python","tags":["finance","market data","historical data","live data","trading","dbn"],"install":[{"cmd":"pip install -U databento","lang":"bash","label":"Install latest stable version"}],"dependencies":[{"reason":"Asynchronous HTTP client functionality.","package":"aiohttp","optional":false},{"reason":"Core library for Databento Binary Encoding (DBN) handling.","package":"databento-dbn","optional":false},{"reason":"Numerical operations, often used in conjunction with pandas DataFrames.","package":"numpy","optional":false},{"reason":"Data manipulation and analysis, particularly for DataFrame conversion.","package":"pandas","optional":false},{"reason":"Manages system certificates, primarily for Windows environments.","package":"pip-system-certs","optional":true},{"reason":"Facilitates Parquet file format support and efficient data handling.","package":"pyarrow","optional":false},{"reason":"Standard HTTP client for interacting with the Databento API.","package":"requests","optional":false},{"reason":"Zstd compression/decompression for efficient data transfer.","package":"zstandard","optional":false}],"imports":[{"symbol":"databento","correct":"import databento as db"},{"note":"As of v0.69.0, DBNRecord was moved from `databento.common.types` to `databento_dbn.DBNRecord`.","wrong":"from databento.common.types import DBNRecord","symbol":"DBNRecord","correct":"from databento_dbn import DBNRecord"}],"quickstart":{"code":"import databento as db\nimport os\n\napi_key = os.environ.get('DATABENTO_API_KEY', 'YOUR_API_KEY')\nif api_key == 'YOUR_API_KEY':\n    print(\"Warning: DATABENTO_API_KEY environment variable not set. Using placeholder.\")\n\nclient = db.Historical(api_key)\n\ntry:\n    data = client.timeseries.get_range(\n        dataset=\"GLBX.MDP3\",\n        schema=\"trades\",\n        symbols=[\"ES.FUT\"],\n        stype_in=\"parent\",\n        start=\"2023-01-01T00:00\",\n        end=\"2023-01-01T01:00\",\n        limit=100\n    )\n    df = data.to_df()\n    print(df.head())\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart initializes a Databento Historical client using an API key (preferably from an environment variable) and requests 100 trade records for E-mini S&P 500 futures for a specific hour on CME Globex, then converts the result to a pandas DataFrame and prints the head."},"warnings":[{"fix":"Access `ts_out` directly as an attribute instead of `__dict__`. `ts_out` returns an `int` (`UNDEF_TIMESTAMP` when not set).","message":"`ts_out` field on record types is now permanent, and `__dict__` attribute has been removed from all Python record classes.","severity":"breaking","affected_versions":">=0.75.0"},{"fix":"This was fixed in v0.74.1 by downgrading `pyo3` to 0.27.2. Users on affected versions should upgrade to >=0.74.1 or ensure their `pyo3` dependency is compatible.","message":"A memory leak of approximately 64 bytes per record object was present in Python bindings due to a `pyo3` 0.28 regression.","severity":"gotcha","affected_versions":"0.74.0"},{"fix":"Update import statements from `from databento.common.types import DBNRecord` to `from databento_dbn import DBNRecord`.","message":"The `DBNRecord` union type was moved from `databento.common.types` to `databento_dbn.DBNRecord`.","severity":"breaking","affected_versions":">=0.69.0"},{"fix":"Update parameter names and stype values in API calls according to the new naming conventions. For example, use `instrument_id` instead of `product_id`.","message":"Multiple API and client library changes affected symbology types (stype) and field renaming. `product_id` was renamed to `instrument_id`. The `smart` stype was split into `parent` and `continuous`. The `native` stype was renamed to `raw_symbol`. The `product_id` stype was renamed to `instrument_id`.","severity":"breaking","affected_versions":"<0.69.0 (changes took effect April 28, 2023)"},{"fix":"Update encoding parameter to `dbn` and use `client.timeseries.get_range()` instead of `client.timeseries.stream()`.","message":"The Databento Binary Encoding (DBN) format changed from `dbz` to `dbn`, and the `timeseries.stream` endpoint was renamed to `timeseries.get_range`.","severity":"breaking","affected_versions":"<0.69.0 (changes took effect March 3, 2023)"},{"fix":"Refactor code to avoid using the `mode` parameter in `metadata.get_cost`.","message":"The `mode` parameter in `metadata.get_cost` has been deprecated and will be removed in a future release.","severity":"deprecated","affected_versions":">=0.65.0"},{"fix":"Upgrade your Python environment to Python 3.10 or newer.","message":"Support for Python 3.9 was removed due to its end-of-life status.","severity":"breaking","affected_versions":">=0.64.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}