Grab your fitbit data

My research team put together a crude fitbit data grabbing web tool that we have used for some of our research. You are welcome to use it, but know that it is ‘alpha’ level in terms of how polished it is. We are not in the business of making web tools - however we will make crude ones for our research aims. Basically, what you should do is make sure you are logged into the fitbit site and then in a new window, go to the following link:

http://vital.usu.edu/fitbitdatagrabber/

(it will redirect, which we are temporarily doing until we get the appropriate server prepped to host it better in the correct address)

Before entering your data grab request, you have to click submit request to authorize connecting to the fitbit site. Make sure to follow the date and time formatting requests.

Recommended browsers are firefox, using private window, or chrome, using incognito window.

If you have issues, restart browsers, clear caches, etc.


Also, if you want to know why this vs. fitbits web service, the main thing is to get .csv files of your minute-by-minute data that you can feed into other visualization or analysis tools.

Sounds pretty cool. A headsup for anyone else trying this:

I initially tried to fetch data for a month - this failed on multiple tries (notices/warnings and eventually hitting the php timelimit).

It worked fine if you limit the range to a couple of days tho.

@Victor: Is it possible or planned to get the sourcecode hosted on github or something? I would like to integrate it into my personal datagrabbing cronjob api thing system which accumulates all the data in a central spot. Alternatively I would just run a script calling and fetch the csv’s from your url split up into working timeframes (I would have to test what the maximum working range is).

This would probably put strain on your website service if I try to fetch the data for about 6 months or so, so just running it locally from my pc would avoid that.

Anyways great job and thanks for making it accessible to the public! I was especially interested in the minute data and the Fitbit provided api kinda sucks in this regard.

Hi ghostface -

I relayed your request to the primary assistant I have working on this. Thanks for flagging the ‘big grab’ issues.

As I am not primarily a developer, I have to defer to my assistant who has been involved with the nitty gritty. Basically, it still has to go through the fitbit API. However, he’s going to look into cleaning things up so that it could potentially do bigger grabs more efficiently and elegantly.

Please feel free to use the webpage as much as you need.

Stay tuned!

Hi there!

Looks like a great tool! Unfortunately, I haven’t been able to make it work even for small ranges. I keep getting the following message, which could be any number of things as far as I can tell:

[quote]
Notice: Trying to get property of non-object in /var/www/fitbit/test.php on line 58 Fatal error: Call to a member function addChild() on a non-object in /var/www/fitbit/test.php on line 59 [/quote]

Just thought of giving some feedback, let me know if you need any more data - I’ll be happy to help:) Thanks for your efforts!

The person who has done our development hasn’t been able to replicate the bug except under the following conditions:

  1. The date isn’t formatted EXACTLY right. (the form is pretty picky)
  2. One of the dates or times is ‘in the future’

There is a pretty silly sequence of steps to take to get the information, but if you are having that issue still for a short time period with the EXTREMELY picky formatting and query requirements, let us know!

Hmmm, strange. Now I am getting the following message:

with anything reasonable I try, for example:

[quote]Start Date (YYYY-mm-dd): 2013-07-11
End Date (YYYY-mm-dd): 2013-07-11
Start Time (HH:MM): 09:00
End Time (HH:MM): 18:00[/quote]

However! When I “broke” it once, by searching for something unreasonable (i.e. last 6 months), I started getting the previous message and now I keep getting it even for the above query, even when I change browser and/or ip address. Maybe I should mention that I am at GMT+2 timezone, although I don’t see how that could be related for queries in the past.

Hope the above help a bit!

will forward, thanks!


I’m trying to get our development person (who put the tool together to help with some of our other activities, but isn’t really a full time developer) to join the forum so he can respond immediately (rather than have me as the middle person).

to quote him:
It breaks down when you do a single day query. As it stands, only multi day queries will work. The problem is with the way the single day data is formatted, I think.

So, while obnoxious, try it over at least more than one day (but not too many since too much data breaks things too). While we aren’t focusing on building something for worldwide use, we do like to know about bugs and issues. Again, big thanks for your comments.

Update, quoted from assistant who has been working on this. There is a new data structure underneath it all, which is allowing more flexibility:

The single day request problem is solved
The length of data that can be requested at once is increased to 3 weeks
I have code in place to make it okay to leave out the times (it will just collect a whole day’s worth of data).

It works great! I tested all the cases you mention, including the 3 week period, and it worked just right. I was even surprised to see that the response in the 3 week case was a lot faster than I expected! Thanks a million for this tool, I hope people enjoy it as much as I do :slight_smile: