Fitness Trackers

Let’s scrape data from our fitness trackers!


Fitbit One

Here’s a code sample which reads data from Fitbit.
It uses the terrific Temboo library for interfacing with the Fitbit API:
https://github.com/golanlevin/IACD2014/blob/master/processingFitbit1.pde
To use it, you will need both a Fitbit account and a Temboo account.

Furthermore, in order to fetch your Fitbit data with this code, you will need to first use the Fitbit App registration and Temboo OAuth Wizard beforehand to obtain: your Fitbit accessToken, accessTokenSecret, consumerSecret, and consumerKey.


Nike Fuelband

To get data from the Nike Fuelband, you can use this code:
https://github.com/golanlevin/IACD2014/blob/master/FuelDataScraper.pde

However, in order for that code to work, you will need to obtain your Fuelband’s deviceID and accessToken. Instructions for doing so are adapted from this link. Basically, you will need to use Charles, an HTTP proxy & packet sniffer, in order to obtain those keys: http://www.charlesproxy.com/download/. Here’s the summary for doing so:

How to get the deviceID and accessToken
1) In Charles, set up the proxy settings for api.nike.com
– open the proxy settings
– click ‘SSL’
– add api.nike.com to the locations list.
2) Plug in your nike fitness tracker
3) In the Charles sequence view, search for “api.nike.com”
– there should be a few urls here
– you want /v1.0/me/sync/lasttimestamp
– the device id will be in the query parameters

 

Once you have scraped the Fuelband data, you can parse it with this parser:
https://github.com/golanlevin/IACD2014/blob/master/FuelDataParser.pde