oura-api

Crates.iooura-api
lib.rsoura-api
version0.1.2
sourcesrc
created_at2023-09-08 20:11:03.855867
updated_at2023-10-08 18:51:03.507299
descriptionA client for the Oura V2 REST API
homepagehttps://github.com/cluebbehusen/rust-oura-api
repositoryhttps://github.com/cluebbehusen/rust-oura-api
max_upload_size
id967750
size19,214
Connor Luebbehusen (cluebbehusen)

documentation

https://docs.rs/oura-api/latest/oura_api/

README

rust-oura-api

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.

Features

Supports fetching following items from the Oura API and deserializing them into Rust structs:

  • Daily Activity
  • Daily Readiness
  • Daily Sleep
  • Daily SpO2
  • Heart Rate
  • Personal Info
  • Rest Mode Period
  • Ring Configuration
  • Session
  • Sleep
  • Sleep Time
  • Tag
  • Workout
  • TagV2

Example Usage

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.

Commit count: 32

cargo fmt