This is not an official Fitbit CLI
Access your Fitbit data directly from your terminal π». View π€ sleep logs, β€οΈ heart rate, ποΈββοΈ activity levels, π©Έ SpO2, and more, all presented in a simple, easy-to-read table format!
Only
GET
APIs are supported!
API | Status |
---|---|
User | β |
Sleep | β |
SpO2 | β |
Heart Rate Time Series | β |
Active Zone Minutes (AZM) Time Series | β |
Activity | β |
- Install the Fitbit CLI
python -m pip install fitbit-cli
- Help
fitbit-cli -h
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]] [-u] [-v]
Fitbit CLI -- Access your Fitbit data at your terminal.
options:
-h, --help show this help message and exit
-i, --init-auth Initialize Fitbit iterative authentication setup
-v, --version Show fitbit-cli version
APIs:
Specify date ranges (ISO 8601 format: YYYY-MM-DD) for the following arguments.
You can provide a single date or a range (start,end). If not provided, defaults to today's date.
-s, --sleep [DATE[,DATE]]
Show sleep data
-o, --spo2 [DATE[,DATE]]
Show SpO2 data
-e, --heart [DATE[,DATE]]
Show Heart Rate Time Series data
-a, --active-zone [DATE[,DATE]]
Show Active Zone Minutes (AZM) Time Series data
-u, --show-user-profile
Show user profile data
-
Register Fitbit App
- Go to https://dev.fitbit.com/apps
- Click on "REGISTER AN APP" tab
- Follow below example and register an app
-
Run the following command to set up interactive authentication and store the Fitbit token locally
fitbit-cli --init-auth
-
Start using it π
$ fitbit-cli -s
Sleep Data Summary π΄
ββββββββββββββ³βββββββββββββββ³βββββββββββββββββ³βββββββββββββββ³βββββββββββββββ³ββββββββββββββββ
β Date π β Deep Sleep π β Light Sleep π€ β REM Sleep π β Wake Time β° β Efficiency π― β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 2024-12-25 β 139 min β 190 min β 155 min β 54 min β 55% β
ββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ
NOTE: The token is valid for only 8 hours, fitbit-cli
automatically refreshes the token when it expires.
git clone [email protected]:veerendra2/fitbit-cli.git
cd fitbit-cli
python -m venv venv
source venv/bin/activate
python -m pip install -e .