fitbit-cli


Namefitbit-cli JSON
Version 1.5.1 PyPI version JSON
download
home_pagehttps://github.com/veerendra2/fitbit-cli
SummaryAccess your Fitbit data at your terminal.
upload_time2025-10-15 19:49:15
maintainerNone
docs_urlNone
authorveerendra2
requires_python>=3.9
licenseMIT
keywords fitbit fitbit-api cli python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fitbit CLI

[![Release](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg)](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml) [![PyPI - Status](https://img.shields.io/pypi/status/fitbit-cli)
](https://pypi.org/project/fitbit-cli/) [![PyPI - Version](https://img.shields.io/pypi/v/fitbit-cli)
](https://pypi.org/project/fitbit-cli/) [![ClickPy Stats](https://img.shields.io/badge/ClickPy%20Stats-A5951E)
](https://clickpy.clickhouse.com/dashboard/fitbit-cli)

> 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!

<p align="center">
  <img alt="Fitbit logo", width="350" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/Fitbit_Logo_White_RGB.jpg">
</p>

[![asciicast](https://asciinema.org/a/732208.svg)](https://asciinema.org/a/732208)

## Supported Web APIs

> Only `GET` APIs are supported!

| API                                                                                                                                                     | Status |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| [Get Profile](https://dev.fitbit.com/build/reference/web-api/user/get-profile/)                                                                         | โœ…     |
| [Get Devices](https://dev.fitbit.com/build/reference/web-api/devices/get-devices/)                                                                      | โœ…     |
| [Get Sleep Log by Date Range](https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date-range/)                                        | โœ…     |
| [Get SpO2 Summary by Interval](https://dev.fitbit.com/build/reference/web-api/spo2/get-spo2-summary-by-interval/)                                       | โœ…     |
| [Get Heart Rate Time Series by Date Range](https://dev.fitbit.com/build/reference/web-api/heartrate-timeseries/get-heartrate-timeseries-by-date-range/) | โœ…     |
| [Get AZM Time Series by Interval](https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/get-azm-timeseries-by-interval/)        | โœ…     |
| [Get Breathing Rate Summary by Interval](https://dev.fitbit.com/build/reference/web-api/breathing-rate/get-br-summary-by-interval/)                     | โœ…     |
| [Get Daily Activity Summary](https://dev.fitbit.com/build/reference/web-api/activity/get-daily-activity-summary/)                                       | โœ…     |

## Usage Guide

1. Install the Fitbit CLI

```bash
python -m pip install fitbit-cli
```

2. See Help

```bash
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]] [-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
  -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.
  -t, --activities [DATE[,DATE]|RELATIVE]
                        Show Daily Activity Summary.
  -u, --user-profile    Show Profile.
  -d, --devices         Show Devices.
```

3. Register Fitbit App

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

     <p align="left">
       <img alt="Fitbit logo", width="700" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/fitbit-app-registration.png">
     </p>

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

   ```bash
    fitbit-cli --init-auth
   ```

   [![asciicast](https://asciinema.org/a/696115.svg)](https://asciinema.org/a/696115)

5. Start using it ๐Ÿ˜Ž

```bash
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

- [Fitbit Docs](https://dev.fitbit.com/build/reference/web-api/)
- [OAuth Tutorial](https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/oauth2-tutorial/)

```bash
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
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/veerendra2/fitbit-cli",
    "name": "fitbit-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "fitbit, fitbit-api, cli, python",
    "author": "veerendra2",
    "author_email": "vk.tyk23@simplelogin.com",
    "download_url": "https://files.pythonhosted.org/packages/ed/8f/94ad5d69a3d9dbc8a539355ccf021a1985e88531bf278beb5e3747aef5e5/fitbit_cli-1.5.1.tar.gz",
    "platform": null,
    "description": "# Fitbit CLI\n\n[![Release](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg)](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml) [![PyPI - Status](https://img.shields.io/pypi/status/fitbit-cli)\n](https://pypi.org/project/fitbit-cli/) [![PyPI - Version](https://img.shields.io/pypi/v/fitbit-cli)\n](https://pypi.org/project/fitbit-cli/) [![ClickPy Stats](https://img.shields.io/badge/ClickPy%20Stats-A5951E)\n](https://clickpy.clickhouse.com/dashboard/fitbit-cli)\n\n> This is not an official Fitbit CLI\n\nAccess your Fitbit data directly from your terminal \ud83d\udcbb. View \ud83d\udca4 sleep logs, \u2764\ufe0f heart rate, \ud83c\udfcb\ufe0f\u200d\u2642\ufe0f activity levels, \ud83e\ude78 SpO2, and more, all presented in a simple, easy-to-read table format!\n\n<p align=\"center\">\n  <img alt=\"Fitbit logo\", width=\"350\" src=\"https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/Fitbit_Logo_White_RGB.jpg\">\n</p>\n\n[![asciicast](https://asciinema.org/a/732208.svg)](https://asciinema.org/a/732208)\n\n## Supported Web APIs\n\n> Only `GET` APIs are supported!\n\n| API                                                                                                                                                     | Status |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |\n| [Get Profile](https://dev.fitbit.com/build/reference/web-api/user/get-profile/)                                                                         | \u2705     |\n| [Get Devices](https://dev.fitbit.com/build/reference/web-api/devices/get-devices/)                                                                      | \u2705     |\n| [Get Sleep Log by Date Range](https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date-range/)                                        | \u2705     |\n| [Get SpO2 Summary by Interval](https://dev.fitbit.com/build/reference/web-api/spo2/get-spo2-summary-by-interval/)                                       | \u2705     |\n| [Get Heart Rate Time Series by Date Range](https://dev.fitbit.com/build/reference/web-api/heartrate-timeseries/get-heartrate-timeseries-by-date-range/) | \u2705     |\n| [Get AZM Time Series by Interval](https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/get-azm-timeseries-by-interval/)        | \u2705     |\n| [Get Breathing Rate Summary by Interval](https://dev.fitbit.com/build/reference/web-api/breathing-rate/get-br-summary-by-interval/)                     | \u2705     |\n| [Get Daily Activity Summary](https://dev.fitbit.com/build/reference/web-api/activity/get-daily-activity-summary/)                                       | \u2705     |\n\n## Usage Guide\n\n1. Install the Fitbit CLI\n\n```bash\npython -m pip install fitbit-cli\n```\n\n2. See Help\n\n```bash\nfitbit-cli -h\nusage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]] [-b [DATE[,DATE]|RELATIVE]] [-t [DATE[,DATE]|RELATIVE]] [-u] [-d] [-v]\n\nFitbit CLI -- Access your Fitbit data at your terminal.\n\noptions:\n  -h, --help            show this help message and exit\n  -i, --init-auth       Initialize Fitbit iterative authentication setup\n  -v, --version         Show fitbit-cli version\n\nAPIs:\n  Specify a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.\n  Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).\n  If not provided, defaults to today's date.\n\n  -s, --sleep [DATE[,DATE]|RELATIVE]\n                        Show Sleep Log by Date Range.\n  -o, --spo2 [DATE[,DATE]|RELATIVE]\n                        Show SpO2 Summary by Interval.\n  -e, --heart [DATE[,DATE]|RELATIVE]\n                        Show Heart Rate Time Series by Date Range.\n  -a, --active-zone [DATE[,DATE]|RELATIVE]\n                        Show AZM Time Series by Interval.\n  -b, --breathing-rate [DATE[,DATE]|RELATIVE]\n                        Show Breathing Rate Summary by Interval.\n  -t, --activities [DATE[,DATE]|RELATIVE]\n                        Show Daily Activity Summary.\n  -u, --user-profile    Show Profile.\n  -d, --devices         Show Devices.\n```\n\n3. Register Fitbit App\n\n   1. Go to [https://dev.fitbit.com/apps](https://dev.fitbit.com/apps)\n   2. Click on \"REGISTER AN APP\" tab\n   3. Follow below example and register an app\n\n     <p align=\"left\">\n       <img alt=\"Fitbit logo\", width=\"700\" src=\"https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/fitbit-app-registration.png\">\n     </p>\n\n4. Run the following command to set up interactive authentication and store the Fitbit token locally\n\n   ```bash\n    fitbit-cli --init-auth\n   ```\n\n   [![asciicast](https://asciinema.org/a/696115.svg)](https://asciinema.org/a/696115)\n\n5. Start using it \ud83d\ude0e\n\n```bash\nfitbit-cli -s\n                                            Sleep Data Summary \ud83d\ude34\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Date \ud83d\udcc6    \u2503 Deep Sleep \ud83d\udecf \u2503 Light Sleep \ud83d\udca4 \u2503 REM Sleep \ud83c\udf19 \u2503 Wake Time \u23f0 \u2503 Efficiency \ud83d\udcaf \u2503 Time in Bed \ud83d\udd50 \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 2025-05-03 \u2502 129 min      \u2502 271 min        \u2502 140 min      \u2502 66 min       \u2502 57%           \u2502 10.1 hr        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_\n\n## Local Development\n\n- [Fitbit Docs](https://dev.fitbit.com/build/reference/web-api/)\n- [OAuth Tutorial](https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/oauth2-tutorial/)\n\n```bash\ngit clone git@github.com:veerendra2/fitbit-cli.git\ncd fitbit-cli\n\npython -m venv venv\nsource venv/bin/activate\npython -m pip install -e .\n\ndeactivate\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Access your Fitbit data at your terminal.",
    "version": "1.5.1",
    "project_urls": {
        "Documentation": "https://github.com/veerendra2/fitbit-cli",
        "Download": "https://github.com/veerendra2/fitbit-cli/archive/1.5.1.tar.gz",
        "Homepage": "https://github.com/veerendra2/fitbit-cli"
    },
    "split_keywords": [
        "fitbit",
        " fitbit-api",
        " cli",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ed8f94ad5d69a3d9dbc8a539355ccf021a1985e88531bf278beb5e3747aef5e5",
                "md5": "4a83a7c71c22ebe892bf39719a8a8123",
                "sha256": "ff80a70872af072f54559db8cb817c77309f2634d63f406048f3237f7c7c3528"
            },
            "downloads": -1,
            "filename": "fitbit_cli-1.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4a83a7c71c22ebe892bf39719a8a8123",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 15219,
            "upload_time": "2025-10-15T19:49:15",
            "upload_time_iso_8601": "2025-10-15T19:49:15.629036Z",
            "url": "https://files.pythonhosted.org/packages/ed/8f/94ad5d69a3d9dbc8a539355ccf021a1985e88531bf278beb5e3747aef5e5/fitbit_cli-1.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-15 19:49:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "veerendra2",
    "github_project": "fitbit-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fitbit-cli"
}
        
Elapsed time: 2.78983s