/fitbit-googlefit

Export Fitbit data to Google Fit. Unlike fitnessyncer.com, this aims to offer very fine intraday granularity (every minute/second).

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Introduction


Export all your Fitbit data to Google Fit.

Unlike other alternatives, such as fitnessyncer.com, this aims to offer very fine granularity for the data.

Fitbit Steps GoogleFit Steps

Features


  • Steps - minute level precision
  • Distance - minute level precision
  • Heart rate - second level precision
  • Weight
  • Body fat
  • Activities
    • Running
    • Swimming
    • Biking
    • Volleyball
    • Walking
    • Badminton
    • Workouts (as weightlifting)
    • Others (as running) -- awaiting suggestions
  • Calories - minute level precision
  • Floors - minute level precision
  • Elevation - minute level precision
  • Food logs

Setup


You have to register your own Fitbit and Google Fit applications. This setup is a one time thing.

  1. Install dependencies

This is python3 application so install all the dependencies using sudo pip3 install -r requirements.txt

  1. Fitbit setup

All instructions below must be performed using the same Fitbit account you want to sync with Google Fit.

Application Name : --
Description : --
Application Website : --
Organization : --
Organization Website : --
OAuth 2.0 Application Type : Personal
Callback URL : http://localhost:8080/
Default Access Type : Read-Only

Note : 
1. Use your own information for fields marked --
2. Make sure you copy the Callback URL exactly (including the last /)
  • Hit save and make a note of OAuth 2.0 Client ID and Client Secret
  • cd /auth and run python3 auth_fitbit.py <client-id> <client-secret>
  • This opens a popup in the browser. Authenticate and done!
  1. Google Fit setup

  • Go to the Google Developers Console
  • Click Continue. Then select Go to credentials and select Client ID
  • Under Application type, select Other and hit Create
  • Make a note of client ID and client secret
  • cd /auth and run python3 auth_google.py <client-id> <client-secret>
  • This opens a popup in the browser. Authenticate and done!

Usage


Update the config.ini with own choices and start the sync using python3 app.py

Note :

  1. Get command line help using the -h flag.
  2. Arguments passed through command-line take higher priority over config.ini values.