Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New Developer trying to make web app to display fitbit data

Hi, 

I spent quite a bit of time going through the docs for the Web Api, and went through the process of creating an app on dev fitbit.com , then connected it to my device. I also found a medium article which used an unofficial api to help with Oauth called Collect your own fitbit data with python. The issue I have right now is I don't know how/where to get the details of what specific url I need to hit to get data from my device the docs use specific params in the url request which I don't know the value of for my device. I would appreciate if someone could provide a workflow for getting data from device, and where to get the specific values for the params of the endpoints in the web spi. 

Best Answer
0 Votes
11 REPLIES 11

Hi @sim224,

 

Welcome to the forums!

 

You aren't able to access data directly from the device through the Web API. The Web API can only extract data from the user's Fitbit account after the device has synced the data over to the servers.

 

 Can you clarify if you are trying to get raw/live data straight from the sensors of the device? Or are you looking to extract historical data? There is documentation for both processes and I just need to know what you are trying to do so that I can point you in the right direction.

 

I hope to hear from you soon! Let me know if you have any additional questions in the meantime.

Best Answer

Hi,
I am also interested to do some analysis on historical data including Heart rate, Sleep, Pace, Track of movement, etc. Could you please send me the required document? I am going to use python. 

Thanks 

Best Answer
0 Votes

Hi @Amin_Fit_bit 

 

Here's the link to the Web API documentation that will allow you to retrieve the historical data: https://dev.fitbit.com/build/reference/web-api/.   Keep in mind, you're only allowed to query the data for users who have consented to share their data with your application.   Also, check out this community thread where we recently discussed the location of sample python code: https://community.fitbit.com/t5/Web-API-Development/API-Access-to-inspire-HR-data/m-p/3693875#M10882.   It might help you get started.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thank you @GordonFitbit 

Regarding the data query, how can I get permission from Fitbit users for my app? I thought I am able to get the data from all users that have consented to share their data with Fitbit.

Thanks.

Best Answer
0 Votes

Hi @Amin_Fit_bit 

 

The Fitbit users own their data and are allowed to consent / revoke access of their data with the applications they choose.  To request access to a user's data, you'll need to implement the OAuth 2.0 authorization flow in your application which is documented here: https://dev.fitbit.com/build/reference/web-api/oauth2/.  The OAuth 2.0 Tutorial will demonstrate the authorization steps your application needs to follow and what the Fitbit users will see.

 

OAuth 2.0 Tutorial - Access Point.png

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Did it fixed?

Best Answer
0 Votes

Hi @JohnFitbit,

I'm currently trying to investigate whether it's possible to retrieve live data from the device and feed it into a simulation running on mathlab.

For that reason I stumbled across your comment in this thread. 

Can you give me the documentation for the raw/live data process?

Best regards

Lasse

Best Answer
0 Votes

By 'live' data, do you mean real-time data?

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Hi @Lasse9090 

I'm not sure what you mean by "live", but the data is only available after the user syncs their device with the mobile application.  At which time, you can use the Web API to pull the user's data.   The documentation for retrieving user data is https://dev.fitbit.com/build/reference/web-api/.

Let me know if you need anything else,

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

@Gondwana wrote:

By 'live' data, do you mean real-time data?


Yes, thats what i meant!

I saw your previous comments on the threat "Real time heart rate into PC (for Research use" (I dont know if I'm allowed to link it so i will be going by the header), where you described how the basic structure should be build and additionally your latest comments on how its not possible to build such an application on the newer watches because the SDK is missing for those.

To describe my project a little bit further: I'm trying to build a real-time interface between a fitness tracker - that is capable of gathering heart rate and sO2 - and a simulation run on MatLab. The simulation simulates a life support system for futere space exploration mission that runs purely regenerativ. In my case im focused on the gas exchange between atmosphere and astronauts which is mostly based on the oxygen-curve, which is calculated from the heart rate. Currently the simulation just simulates a static predefined schedule of activities for astronauts living in this atmosphere and the linked oxygen-curve. For my project I'm trying to realise an application that is capable to feed real-time data into the simulation for a more dynamic and more realistic gas exchange, so that idealy testperson can be equipped with trackers that are hooked to the simulation, perform various tasks and the simulation react in real time to these various tasks.

To get back to my question, do you think the architecture you described in the above mentioned threat will put me in a position where i can realise all of this/parts of my project? And if so, do you guys have suggestions on trackers that i can use for that project?


Best Answer
0 Votes

@Lasse9090 wrote:

...do you think the architecture you described in the above mentioned threat will put me in a position where i can realise all of this/parts of my project?...


No Fitbit watches provide real-time SpO2 data, and only some superseded Fitbits provide real-time HR data (and not from the Web API). You could search the SDK forum for info about real-time data and beta SDK usage.

Peter McLennan
Gondwana Software
Best Answer
0 Votes