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
- See Help
fitbit-cli -h
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]]
[-b [DATE[,DATE]|RELATIVE]] [-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 a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.
Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).
If not provided, defaults to today's date.
-s, --sleep [DATE[,DATE]|RELATIVE]
Show sleep data
-o, --spo2 [DATE[,DATE]|RELATIVE]
Show SpO2 data
-e, --heart [DATE[,DATE]|RELATIVE]
Show Heart Rate Time Series data
-a, --active-zone [DATE[,DATE]|RELATIVE]
Show Active Zone Minutes (AZM) Time Series data
-b, --breathing-rate [DATE[,DATE]|RELATIVE]
Show Breathing Rate Summary 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 π― β Time in Bed π β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 2025-05-03 β 129 min β 271 min β 140 min β 66 min β 57% β 10.1 hr β
ββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββ
NOTE: The token is valid for only 8 hours, fitbit-cli
automatically refreshes the token when it expires.
git clone git@github.com:veerendra2/fitbit-cli.git
cd fitbit-cli
python -m venv venv
source venv/bin/activate
python -m pip install -e .
deactivate