Skip to main content

# MyFitbit

Because “Your data belongs to you!”

…and fitbit’s own data export sucks.

![Python version](https://img.shields.io/pypi/pyversions/myfitbit.svg?style=flat) [![Build status](https://img.shields.io/travis/Knio/myfitbit/master.svg?style=flat)](https://travis-ci.org/Knio/myfitbit) [![Coverage status](https://img.shields.io/coveralls/github/Knio/myfitbit/master.svg?style=flat)](https://coveralls.io/r/Knio/myfitbit?branch=master)

## Installation

The recommended way to install myfitbit is with [pip](http://pypi.python.org/pypi/pip/):

sudo pip install myfitbit

[![PyPI version](https://img.shields.io/pypi/v/myfitbit.svg?style=flat)](https://pypi.org/project/myfitbit/) [![PyPI downloads](https://img.shields.io/pypi/dm/myfitbit.svg?style=flat)](https://pypi.org/project/myfitbit/)

Manual installation:

`sh git clone git@github.com:Knio/myfitbit cd myfitbit python3 setup.py install `

## Setup

  1. Register a new app at https://dev.fitbit.com/apps/new

The app should look like this:

The Callback URL must be exactly http://localhost:8189/auth_code

<img src=”docs/fitbit_app.png” width=”271” height=”606”>

  1. Configure the API keys

Make a file myfitbit.ini in your working directory with the client ID and secret you got from registering the fitbit app:

` [fitbit_auth] client_id = 123ABCD client_secret = 0123456789abcdef0a1b2c3d4f5 access_token_file = .myfitbit_access_token `

  1. Export your data

` python3 -m myfitbit `

This will open a web browser and prompt you to allow the app to access your data.

It will then begin exporting to your current working directory.

Note that the fitbit API is rate limited to 150 calls/hour, and you can query only 1 day of heartrate data at a time. If you many days of data, you will be rate limited and see an HTTP 429 error. Simply re-run the command an hour later and it will resume downloading where it left off.

  1. Generate report

` python3 -m myfitbit.report --user 123ABC `

Use the user id seen in the output from step 2

This will generate report.html in your current working directory.

![Fitbit Report](docs/fitbit.png)

Release files for myfitbit 0.7.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 myfitbit 0.7.0
File Size Uploaded
myfitbit-0.7.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for myfitbit 0.7.0
File Interpreter ABI Platform
myfitbit-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / myfitbit-0.7.0.tar.gz

Download URL myfitbit-0.7.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1e697f358b6970ffa4d03791c503003e3b8d179308f88f2369efe9ba2db3a01
BLAKE2b-256 checksum
How to use checksums
bc193b18015200a6ce24b20bdbd841f6f669d0cba3ecc3daebc72deabbc8f07c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.9

Release files / myfitbit-0.7.0-py3-none-any.whl

Download URL myfitbit-0.7.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1d4580845c381568d5c9be7231bf35b9530b2457957cfab21cf0ab9da7559cf
BLAKE2b-256 checksum
How to use checksums
227c9c47253d9605ca1ba64ea8feb8d86c84aa7b7afff4f0ba8504cbfa6262d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.5.0

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

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