Skip to main content

Access your Fitbit data at your terminal.

Project description

Fitbit CLI

Release PyPI - Status PyPI - Version

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!

Fitbit logo

asciicast

Supported Web APIs

Only GET APIs are supported!

API Status
User โœ…
Sleep โœ…
SpO2 โœ…
Heart Rate Time Series โœ…
Active Zone Minutes (AZM) Time Series โœ…
Activity โœ…

Usage Guide

  1. Install the Fitbit CLI
python -m pip install fitbit-cli
  1. 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
  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
    

    For a visual guide, see the Asciinema recording below asciicast

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

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 .

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.2.0.tar.gz (12.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: fitbit_cli-1.2.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fitbit_cli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b4dae7047e0864d2be399966262cb22a9a45d3f02aa6706b1d5a597723137233
MD5 45ede963780752290032ae7081227a6d
BLAKE2b-256 ca3d936a614e9eef6b9930eb898c54ab8bdcf860516559421b4f23478b8155f4

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