How to Download Minute-by-Minute Fitbit Data
Ernesto Ramirez
September 26, 2014
NOTE: The methods detailed in this post no longer work. The post is kept here for archival purposes, but unfortunately you will not be able to access your Fitbit data by following the steps.
Earlier this week we posted an update to our How To instructions for downloading your Fitbit data to Google Spreadsheets. This has been one of our most popular posts over the past few years. One of the most common requests we’ve received is to publish a guide to help people download and store their minute-by-minute level step and activity data. Today we’re happy to finally get that up.
The ability to access and download the minute-by-minute level (what Fitbit calls “intraday”) data requires one more step than what we’ve covered previously for downloading your daily aggregate data. Access to the intraday data is restricted to individuals and developers with access to the “Partner API.” In order to use the Partner API you must email the API team at Fitbit to request access and let them know what you intend to do with that data. Please note that they appear to encourage and welcome these type of requests. From their developer documentation:
Fitbit is very supportive of non-profit research and personal projects. Commercial applications require additional review and are subject to additional requirements. To request access, email api at fitbit.com.
In the video and instructions below I’ll walk you through setting up and using the Intraday Script to access and download your minute-by-minute Fitbit Data.
- Set up your FitBit Developer account and register an app.
- Go to dev.fitbit.com and sign in using your FitBit credentials.
- Click on the “Register an App” at the top right corner of the page.
- Fill in your application information. You can call it whatever you want.
- Make sure to click “Browser” for the Application Type and “Read Only” for the Default Access type fields.
- Read the terms of service and if you agree check the box and click “Register.”
- Request Access to the Partner API
- Email the API team at Fitbit
- They should email you back within a day or two with response
- Copy the API keys for the app you registered in Step 1
- Go to dev.fitbit.com and sign in using your FitBit credentials.
- Click on “Manage My Apps” at the top right corner of the page
- Click on the app you created in Step 1
- Copy the Consumer Key.
- Copy the Consumer Secret.
- You can save these to a text file, but they are also available anytime you return to dev.fitbit.com by clicking on the “Manage my Apps” tab.
- Set up your Google spreadsheet and script
- Open your Google Drive
- Create a new google spreadsheet.
- Go to Tools->Script editor
- Download this script, copy it’s contents, and paste into the script editor window. Make sure to delete all text in the editor before pasting. You can then follow along with the instructions below.
- Select “renderConfigurationDialog” in the Run drop down menu. Click run (the right facing triangle).
- Authorize the script to interact with your spreadsheet.
- Navigate to the spreadsheet. You will see an open a dialog box in your spreadsheet.
- In that dialog paste the Consumer Key and Consumer Secret that you copied from your application on dev.fitbit.com. Click “Save”
- Navigate back to the scrip editor window.
- Select “authorize” in the Run drop down menu. Click run (the right facing triangle).
- Select “authorize” in the Run drop down menu. This will open a dialog box in your spreadsheet. Click yes.
- A new browser window will open and ask you to authorize the application to look at your Fitbit data. Click allow to authorize the spreadsheet script.
- Download your Fitbit Data
- Go back to your script editor window.
- Edit the DateBegin and DateEnd variables with the date period you’d like to download. Remember, this script will only allow 3 to 4 days to be downloaded at a time.
- Select “refreshTimeSeries” in the Run drop down menu. Click run (the right facing triangle).
- Your data should be populating the spreadsheet!
If you’re a developer or have scripting skills we welcome your help improving this intraday data script. Feel free to check out the repo on Github!