fitbit-rs
A work in progress Rust client library for the Fitbit API. Currently implemented are fetching sleep data and activity summaries.
Features
- Authentication using access tokens
- Fetch sleep data with detailed sleep stages and levels
- Fetch activity summaries including steps, calories, heart rate zones, etc.
- Response caching to minimize API calls
Installation
Add the following to your Cargo.toml:
[]
= "0.1.0"
Usage
Basic Usage
use ;
use NaiveDate;
Storing Access Tokens
The library provides utilities for storing and retrieving access tokens:
use ;
Getting an Access Token
To use this library, you need a Fitbit API access token. You can get one by:
- Register an application at dev.fitbit.com
- Use the OAuth 2.0 flow to get an access token
- Store the access token using the
store_access_tokenfunction or pass it directly to the client
Documentation
For more detailed documentation, see the API Documentation.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.