aarathiinair / Fitbit-API-data-extraction

0 stars 0 forks source link

Fitbit API Data Extraction Project Summary

1. Project Overview

This project facilitates the extraction of various health metrics from Fitbit devices:

2. Functionality

3. Data Type Distinctions

4. Application Credentials

Users have two options for API access:

a. Utilize provided credentials:

b. Create a personal Fitbit developer application:

  1. Visit https://dev.fitbit.com/
  2. Select "Manage" and click 'Register An App'
  3. Register or log in and create a new application
  4. Select "Personal" for OAuth 2.0 Application Type
  5. Set Callback URL to http://127.0.0.1:8080/
  6. Select "Save"

Fitbit App Registration

Note: You can put in anything for Application Name, Description, Application Website URL, Organization, Organization Website URL, Terms of Service URL, Privacy Policy URL as long as it doesn't include the word 'fitbit'.

5. Execution Instructions

  1. Install Python and required libraries (requests, pandas)
  2. Insert appropriate Client ID and Client Secret into the scripts (if you're using our own developer app otherwise just start execution of script)
  3. Execute required script via command line: python script_name.py
  4. Input the desired date for data extraction
  5. For initial authorization, use the following URL:
    https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=CLIENT_ID_HERE&redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2F&scope=oxygen_saturation%20electrocardiogram%20sleep%20respiratory_rate%20activity%20heartrate%20temperature%20settings
  6. Replace CLIENT_ID_HERE with 23PHMD if using provided credentials, or your personal Client ID if using a self-created application
  7. Input the resulting authorization code when prompted

6. Authorization Code

7. Output

8. Best Practices