Skip to main content

Fitbit CLI

Release PyPI - Status PyPI - Version ClickPy Stats

This is not an official Fitbit CLI

Deprecation notice: Fitbit is deprecating the legacy Fitbit Web API in favor of the Google Health API. Legacy Fitbit Web API endpoints are expected to be decommissioned in September 2026, and new integrations should use Google Health API instead.

This CLI currently uses the legacy Fitbit Web API. There are no plans to migrate this project to the Google Health API. Until the Fitbit Web API is decommissioned, this project will be maintained in maintenance mode only and may be archived soon.

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!

AI agent-friendly 🤖 — since v1.6.0, use --json for minimized, token-efficient JSON output or --raw-json for the full Fitbit API response. No spinners, pure JSON.

Fitbit logo

asciicast

Supported Web APIs

Only GET APIs are supported!

API Status
Get Profile ✅
Get Devices ✅
Get Sleep Log by Date Range ✅
Get SpO2 Summary by Interval ✅
Get Heart Rate Time Series by Date Range ✅
Get AZM Time Series by Interval ✅
Get Breathing Rate Summary by Interval ✅
Get Daily Activity Summary ✅
Get Body Time Series by Date Range ✅
Get HRV Summary by Interval ✅

Usage Guide

  1. Install the Fitbit CLI
python -m pip install fitbit-cli
  1. See Help
fitbit-cli -h
usage: fitbit-cli [-h] [-i] [-j] [-r] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]]
                  [-b [DATE[,DATE]|RELATIVE]] [-H [DATE[,DATE]|RELATIVE]] [-B [DATE[,DATE]|RELATIVE]]
                  [-t [DATE[,DATE]|RELATIVE]] [-u] [-d] [-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
  -j, --json            Output table data as JSON.
  -r, --raw-json        Output raw JSON from the Fitbit API.
  -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 Log by Date Range.
  -o, --spo2 [DATE[,DATE]|RELATIVE]
                        Show SpO2 Summary by Interval.
  -e, --heart [DATE[,DATE]|RELATIVE]
                        Show Heart Rate Time Series by Date Range.
  -a, --active-zone [DATE[,DATE]|RELATIVE]
                        Show AZM Time Series by Interval.
  -b, --breathing-rate [DATE[,DATE]|RELATIVE]
                        Show Breathing Rate Summary by Interval.
  -H, --hrv [DATE[,DATE]|RELATIVE]
                        Show HRV Summary by Interval.
  -B, --body [DATE[,DATE]|RELATIVE]
                        Show Body Time Series for Weight, BMI, and Body Fat.
  -t, --activities [DATE[,DATE]|RELATIVE]
                        Show Daily Activity Summary.
  -u, --user-profile    Show Profile.
  -d, --devices         Show Devices.
  1. Register Fitbit App

    1. Go to https://dev.fitbit.com/apps
    2. Click on "REGISTER AN APP" tab
    3. Follow below example and register an app

    Fitbit logo

  2. Run the following command to set up interactive authentication and store the Fitbit token locally

     fitbit-cli --init-auth
    

    asciicast

  3. 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.

Local Development

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

Metadata

Release files for fitbit-cli 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fitbit-cli 1.9.0
File Size Uploaded
fitbit_cli-1.9.0.tar.gz 21.1 kB Details

Release files / fitbit_cli-1.9.0.tar.gz

Download URL fitbit_cli-1.9.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b48b0be83366bd9873593d04a67c4d0e65b0e43e5739587168b92a8502bc6dde
BLAKE2b-256 checksum
How to use checksums
6ee88dfc41c525d2510da5241243c6e572247cc20082c04cb64f0b701710c7dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.9.0 This release

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page