{"id":26475815,"url":"https://github.com/databento/databento-cpp","last_synced_at":"2026-02-18T23:02:57.835Z","repository":{"id":62463898,"uuid":"539286517","full_name":"databento/databento-cpp","owner":"databento","description":"The official C++ client library for Databento","archived":false,"fork":false,"pushed_at":"2026-02-13T14:25:29.000Z","size":965,"stargazers_count":69,"open_issues_count":0,"forks_count":21,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-13T23:23:01.597Z","etag":null,"topics":["binary-encoding","databento","historical-data","http","low-latency","market-data","real-time","tcp","tick-data"],"latest_commit_sha":null,"homepage":"https://databento.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/databento.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-21T03:23:00.000Z","updated_at":"2026-02-08T02:15:33.000Z","dependencies_parsed_at":"2023-10-20T22:32:07.392Z","dependency_job_id":"5f495c34-62c9-4002-ac97-021e6af9916b","html_url":"https://github.com/databento/databento-cpp","commit_stats":{"total_commits":203,"total_committers":8,"mean_commits":25.375,"dds":"0.15270935960591137","last_synced_commit":"065bcb611acff17563848811c16a15856097625f"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/databento/databento-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/databento","download_url":"https://codeload.github.com/databento/databento-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29597854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-encoding","databento","historical-data","http","low-latency","market-data","real-time","tcp","tick-data"],"created_at":"2025-03-19T23:50:12.709Z","updated_at":"2026-02-18T23:02:57.822Z","avatar_url":"https://github.com/databento.png","language":"C++","readme":"# databento-cpp\n\n[![test](https://github.com/databento/databento-cpp/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/databento/databento-cpp/actions/workflows/build.yaml)\n[![license](https://img.shields.io/github/license/databento/databento-cpp?color=blue)](./LICENSE)\n[![Slack](https://img.shields.io/badge/join_Slack-community-darkblue.svg?logo=slack)](https://to.dbn.to/slack)\n\nThe official C++ client library for [Databento](https://databento.com).\nThe client supports both streaming real-time and historical market data through similar interfaces.\n\n## Usage\n\nThe minimum C++ standard is C++17 and the minimum CMake version is 3.24.\n\n### Integration\n\nThe easiest way to use our library is by embedding it with [CMake FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html).\nYour `CMakeLists.txt` should look something like the following:\n\n```cmake\n# CMakeLists.txt\ncmake_minimum_required(VERSION 3.24)\n\nproject(databento_example)\ninclude(FetchContent)\n\nFetchContent_Declare(\n  databento\n  GIT_REPOSITORY https://github.com/databento/databento-cpp\n  GIT_TAG main\n)\nFetchContent_MakeAvailable(databento)\n\nadd_executable(example main.cpp)\ntarget_link_libraries(example PRIVATE databento::databento)\n```\n\nAlternatively, you can clone the source code from GitHub [here](https://github.com/databento/databento-cpp).\n\nTo install the library to `/usr`, build and install it with the following:\n\n```sh\ngit clone https://github.com/databento/databento-cpp\ncd databento-cpp\ncmake -S . -B build \\\n  -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\n  -DCMAKE_INSTALL_PREFIX='/usr'\ncmake --build build --target databento --parallel\ncmake --install build\n```\n\nIn your project's `CMakeLists.txt`, add the following:\n\n```cmake\n# CMakeLists.txt\nfind_package(databento REQUIRED)\ntarget_link_libraries(example PRIVATE databento::databento)\n```\n\n### Dependencies\n\nYou'll need to ensure the following dependencies are installed:\n- [OpenSSL](https://www.openssl.org/) (minimum version 3.0)\n- [Libcrypto](https://www.openssl.org/docs/man3.0/man7/crypto.html)\n- [Zstandard (zstd)](https://github.com/facebook/zstd)\n- [nlohmann\\_json (header-only)](https://github.com/nlohmann/json)\n- [cpp-httplib (header-only)](https://github.com/yhirose/cpp-httplib)\n- [date (header-only)](https://github.com/HowardHinnant/date)\n\nBy default, date, cpp-httplib and nlohmann\\_json are downloaded by CMake as part of the build process.\nIf you would like to use a local version of these libraries, enable the CMake flag\n`DATABENTO_USE_EXTERNAL_DATE`, `DATABENTO_USE_EXTERNAL_HTTPLIB`, or `DATABENTO_USE_EXTERNAL_JSON` respectively.\n\n#### Ubuntu\n\nRun the following commands to install the dependencies on Ubuntu:\n```sh\n$ sudo apt update\n$ sudo apt install libssl-dev libzstd-dev\n```\n\n#### macOS\n\nOn macOS, you can install the dependencies with [Homebrew](https://brew.sh/) by running the following:\n```sh\n$ brew install openssl@3 zstd\n```\n\n### Live\n\nReal-time and intraday replay is provided through the Live clients.\nHere is a simple program that fetches 10 seconds of trades for all ES mini futures:\n\n```cpp\n#include \u003cchrono\u003e\n#include \u003cdatabento/live.hpp\u003e\n#include \u003cdatabento/symbol_map.hpp\u003e\n#include \u003ciostream\u003e\n#include \u003cthread\u003e\n\nnamespace db = databento;\n\nint main() {\n  db::PitSymbolMap symbol_mappings;\n\n  auto client = db::LiveThreaded::Builder()\n                    .SetKeyFromEnv()\n                    .SetDataset(db::Dataset::GlbxMdp3)\n                    .BuildThreaded();\n\n  auto handler = [\u0026symbol_mappings](const db::Record\u0026 rec) {\n    symbol_mappings.OnRecord(rec);\n    if (const auto* trade = rec.GetIf\u003cdb::TradeMsg\u003e()) {\n      std::cout \u003c\u003c \"Received trade for \" \u003c\u003c symbol_mappings[trade-\u003ehd.instrument_id]\n                \u003c\u003c ':' \u003c\u003c *trade \u003c\u003c '\\n';\n    }\n    return db::KeepGoing::Continue;\n  };\n\n  client.Subscribe({\"ES.FUT\"}, db::Schema::Trades, db::SType::Parent);\n  client.Start(handler);\n  std::this_thread::sleep_for(std::chrono::seconds{10});\n  return 0;\n}\n```\nTo run this program, set the `DATABENTO_API_KEY` environment variable with an actual API key.\n\n### Historical\n\nHere is a simple program that fetches 10 minutes worth of historical trades for two CME futures:\n\n```cpp\n#include \u003cdatabento/dbn.hpp\u003e\n#include \u003cdatabento/historical.hpp\u003e\n#include \u003cdatabento/symbol_map.hpp\u003e\n#include \u003ciostream\u003e\n\nnamespace db = databento;\n\nint main() {\n  auto client = db::Historical::Builder().SetKey(\"$YOUR_API_KEY\").Build();\n  db::TsSymbolMap symbol_map;\n  auto decode_symbols = [\u0026symbol_map](const db::Metadata\u0026 metadata) {\n    symbol_map = metadata.CreateSymbolMap();\n  };\n  auto print_trades = [\u0026symbol_map](const db::Record\u0026 record) {\n    const auto\u0026 trade_msg = record.Get\u003cdb::TradeMsg\u003e();\n    std::cout \u003c\u003c \"Received trade for \" \u003c\u003c symbol_map.At(trade_msg) \u003c\u003c \": \" \u003c\u003c trade_msg\n              \u003c\u003c '\\n';\n    return db::KeepGoing::Continue;\n  };\n  client.TimeseriesGetRange(\"GLBX.MDP3\", {\"2022-06-10T14:30\", \"2022-06-10T14:40\"},\n                            {\"ESM2\", \"NQZ2\"}, db::Schema::Trades, db::SType::RawSymbol,\n                            db::SType::InstrumentId, {}, decode_symbols, print_trades);\n}\n```\n\nTo run this program, set the `DATABENTO_API_KEY` environment variable with an actual API key.\n\nAdditional example standalone executables are provided in the [`example`](./example) directory.\nThese examples can be compiled by enabling the cmake option `DATABENTO_ENABLE_EXAMPLES` with `-DDATABENTO_ENABLE_EXAMPLES=1` during the configure step.\n\n## Documentation\n\nYou can find more detailed examples and the full API documentation on the [Databento doc site](https://databento.com/docs/quickstart?historical=cpp\u0026live=cpp).\n\n## License\n\nDistributed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0.html).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabento%2Fdatabento-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabento%2Fdatabento-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabento%2Fdatabento-cpp/lists"}