Skip to main content

Access your Fitbit data at your terminal.

Project description

Fitbit CLI

Release PyPI - Status PyPI - Version ClickPy Stats

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!

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitbit_cli-1.8.0.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file fitbit_cli-1.8.0.tar.gz.

File metadata

  • Download URL: fitbit_cli-1.8.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for fitbit_cli-1.8.0.tar.gz
Algorithm Hash digest
SHA256 fdb74564ba9d4f0adfadcbbafa90a81a25c3ac2fefd90e8579278f42235191ed
MD5 3092b6bc012871691c3fb29e8aba4c76
BLAKE2b-256 00ac24380b8dba697eaf203ec507d307e1a4264d5708b79b2eea76b2a4106049

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page