Tag Archives: download data

How to Download Minute-by-Minute Fitbit Data

IntradayDataChart

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.

  1. 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.”
  2. Request Access to the Partner API
    • Email the API team at Fitbit
    • They should email you back within a day or two with  response
  3. 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.
  4. 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.
  5. 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!

Posted in Lab Notes, Personal Projects | Tagged , , , , , , , | 5 Comments

How to Download Your Zeo Data

ZeoData
If you’re a loyal, or even infrequent user of the Zeo sleep tracking device then you’ve probably heard the sad news that the company has shut down. This opens up a lot of questions about what is means to make consumer devices in this day and age, but rather than focus on those issues we’ld like to talk a bit about data.

Zeo has been unfortunately a little quiet on the communication front and there are quite a few users out there who are wondering about what will happen to all those restless nights and sound sleeps that were captured by their device. This has been compounded by the fact that the Zeo website went down for a short time (it is up as of this writing) closing off access to user accounts and the data therein. Lucky for you there have been quite a few enterprising and enthusiastic individuals who have taken the time to create or highlight ways to capture and store your Zeo data.

Use The Zeo Website
You can’t fault Zeo with making it hard to access your own data. As long as their website is up you can easily download your sleep data from by logging into your user account at mysleep.myzeo.com. After logging into your account you will see a link on the right hand side labeled “Export Data.” Click that link and you’ll be able to download a CSV file containing all your sleep data. They’ve even provided a description of the data and formats that you can download here.

Eric Blue’s FreeMyZeo Data Exporter
QS Los Angeles Meetup Organizer and hacker extraordinaire whipped up a simple data export tool using the Zeo API. The great thing about Eric’s is that even if the myZeo web portal goes down this tool should continue to work.

Download Data Directly From the Device
If you’re using a Zeo bedside device then you can continue to use it and download the data  directly from the memory card without relying on uploading it to the Zeo website. In order to do this you’ll have to read the documentation and use the Data Decoder Library. These files are hard to find as they’ve been removed from the Zeo developer website, but you can access them from our Forum thanks to our friend Dan Dascalesu.  Zeo also created a viewer using this library that you can use via this Sourceforge page.

If you’ve found another way to download Zeo data please let us know. You can also participate in the great forum discussion that inspired this post.

Posted in Discussions, Tool Roundups | Tagged , , , , | 3 Comments