{"id":26475813,"url":"https://github.com/databento/databento-rs","last_synced_at":"2025-04-10T02:19:07.644Z","repository":{"id":185732029,"uuid":"653316826","full_name":"databento/databento-rs","owner":"databento","description":"The official Rust client library for Databento","archived":false,"fork":false,"pushed_at":"2025-04-09T14:14:17.000Z","size":300,"stargazers_count":52,"open_issues_count":1,"forks_count":3,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-10T02:18:54.142Z","etag":null,"topics":["async","databento","historical-data","http","market-data","real-time","tcp","tick-data"],"latest_commit_sha":null,"homepage":"https://databento.com","language":"Rust","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}},"created_at":"2023-06-13T20:29:52.000Z","updated_at":"2025-04-09T00:38:22.000Z","dependencies_parsed_at":"2023-09-22T03:14:00.855Z","dependency_job_id":"d7df7011-ef13-490f-a64c-732166bd25c4","html_url":"https://github.com/databento/databento-rs","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.0892857142857143,"last_synced_commit":"5d410ed4e012e91b85141b8d14f5cd8093ece938"},"previous_names":["databento/databento-rs"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databento%2Fdatabento-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/databento","download_url":"https://codeload.github.com/databento/databento-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142906,"owners_count":21054672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["async","databento","historical-data","http","market-data","real-time","tcp","tick-data"],"created_at":"2025-03-19T23:50:12.567Z","updated_at":"2025-04-10T02:19:07.614Z","avatar_url":"https://github.com/databento.png","language":"Rust","readme":"# databento-rs\n\n[![build](https://github.com/databento/databento-rs/actions/workflows/build.yaml/badge.svg)](https://github.com/databento/dbn/actions/workflows/build.yaml)\n[![Documentation](https://img.shields.io/docsrs/databento)](https://docs.rs/databento/latest/databento/)\n[![license](https://img.shields.io/github/license/databento/databento-rs?color=blue)](./LICENSE)\n[![Current Crates.io Version](https://img.shields.io/crates/v/databento.svg)](https://crates.io/crates/databento)\n[![Slack](https://img.shields.io/badge/join_Slack-community-darkblue.svg?logo=slack)](https://to.dbn.to/slack)\n\nThe official Rust client library for [Databento](https://databento.com).\nThe clients support fast and safe streaming of both real-time and historical market data\nthrough similar interfaces.\n\n## Installation\n\nTo add the crate to an existing project, run the following command:\n```sh\ncargo add databento\n```\n\n## Usage\n\n### Live\n\nReal-time and intraday replay is provided through the Live clients.\nHere is a simple program that fetches the next ES mini futures trade:\n\n```rust\nuse std::error::Error;\n\nuse databento::{\n    dbn::{Dataset, PitSymbolMap, SType, Schema, TradeMsg},\n    live::Subscription,\n    LiveClient,\n};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let mut client = LiveClient::builder()\n        .key_from_env()?\n        .dataset(Dataset::GlbxMdp3)\n        .build()\n        .await?;\n    client\n        .subscribe(\n            Subscription::builder()\n                .symbols(\"ES.FUT\")\n                .schema(Schema::Trades)\n                .stype_in(SType::Parent)\n                .build(),\n        )\n        .await\n        .unwrap();\n    client.start().await?;\n\n    let mut symbol_map = PitSymbolMap::new();\n    // Get the next trade\n    while let Some(rec) = client.next_record().await? {\n        if let Some(trade) = rec.get::\u003cTradeMsg\u003e() {\n            let symbol = \u0026symbol_map[trade];\n            println!(\"Received trade for {symbol}: {trade:?}\");\n            break;\n        }\n        symbol_map.on_record(rec)?;\n    }\n    Ok(())\n}\n```\nTo run this program, set the `DATABENTO_API_KEY` environment variable with an API key and run `cargo run --example historical`\n\n### Historical\n\nHere is a simple program that fetches 10 minutes worth of historical trades for the entire CME Globex market:\n```rust\nuse std::error::Error;\n\nuse databento::{\n    dbn::{Schema, TradeMsg},\n    historical::timeseries::GetRangeParams,\n    HistoricalClient, Symbols,\n};\nuse time::macros::{date, datetime};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let mut client = HistoricalClient::builder().key_from_env()?.build()?;\n    let mut decoder = client\n        .timeseries()\n        .get_range(\n            \u0026GetRangeParams::builder()\n                .dataset(\"GLBX.MDP3\")\n                .date_time_range((\n                    datetime!(2022-06-10 14:30 UTC),\n                    datetime!(2022-06-10 14:40 UTC),\n                ))\n                .symbols(Symbols::All)\n                .schema(Schema::Trades)\n                .build(),\n        )\n        .await?;\n    let symbol_map = decoder\n        .metadata()\n        .symbol_map_for_date(date!(2022 - 06 - 10))?;\n    while let Some(trade) = decoder.decode_record::\u003cTradeMsg\u003e().await? {\n        let symbol = \u0026symbol_map[trade];\n        println!(\"Received trade for {symbol}: {trade:?}\");\n    }\n    Ok(())\n}\n```\n\nTo run this program, set the `DATABENTO_API_KEY` environment variable with an API key and run `cargo bin --example live`.\n\n## Documentation\n\nYou can find more detailed examples and the full API documentation on the [Databento docs site](https://databento.com/docs/quickstart?historical=rust\u0026live=rust).\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-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabento%2Fdatabento-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabento%2Fdatabento-rs/lists"}