Crates.io | oura-api |
lib.rs | oura-api |
version | 0.1.2 |
source | src |
created_at | 2023-09-08 20:11:03.855867 |
updated_at | 2023-10-08 18:51:03.507299 |
description | A client for the Oura V2 REST API |
homepage | https://github.com/cluebbehusen/rust-oura-api |
repository | https://github.com/cluebbehusen/rust-oura-api |
max_upload_size | |
id | 967750 |
size | 19,214 |
A client for the Oura V2 REST API, written in Rust.
Documentation for the Oura V2 API is available here.
The client relies on reqwest for the underlying HTTP client and serde for serialization and deserialization.
Supports fetching following items from the Oura API and deserializing them into Rust structs:
use oura_api::{OuraClient, DateQuery};
// token is the personal access token for the Oura API
let token = std::env::var("OURA_PERSONAL_ACCESS_TOKEN").unwrap();
let client = OuraClient::new(&token);
let august_date_query = DateQuery::builder().start_date("2023-08-01").end_date("2023-08-31").build();
let august_daily_sleep = client.list_daily_sleep(august_date_query).unwrap();
For instructions on how to generate a personal access token, see the Oura docs.