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

Can I download my personal data via a REST API??

Hi, I'm not interested in building a watch application, nor a Web application. Instead, I would simply like to download my own, personal FitBit data into my own Qt desktop application (via a REST API). This simple app is primarily a learning tool to get some network programming experience, but also would just like to poke around in my own data.

 

Can someone tell me how (or if) I can do that, and if so, how to register for an Auth token?

 

Thanks in advance

Best Answer
0 Votes
17 REPLIES 17

Hey, what you could do is get the data to a companion app from your ionic. then you could do a fetch request with method: "POST"  to your end points. 

 

 

Best Answer
0 Votes

Thanks Thiern...

However, i'm not sure that will work... First of all, I only have a charge 2, not an Ionic, and I'm still not sure how to register for an Auth token... but, I will into the Companion App angle a bit more...

Appreciate your input, regardless!

Best Answer
0 Votes

Please note that I moved this topic to the API forum.

Best Answer
0 Votes

Hi Wayne,

 

To download your own data using a REST API, you can use the Fitbit Web API.

Best Answer
0 Votes

HI SiddhiFitbit,

I tried that, but it wants my Web app url, etc. during registration, and I don't have one. I'm just trying to build a good-old desktop application.... unless I'm missing something obvious???

 

Thanks, regardless

Best Answer
0 Votes

Hi Wayne,

 

In that case, you can register your app with any redirect url of your choice, and use your web browser to obtain the authorization code and then an access token. Your app can then make use of this access token/refresh token (*refresh token if you are using the Authorization Code Grant flow). A detailed explanation of how the Fitbit Oauth2 implementation works can be found here https://dev.fitbit.com/build/reference/web-api/oauth2/; you can also refer to https://dev.fitbit.com/apps/oauthinteractivetutorial to see how it works.

Best Answer
0 Votes

I realise this is an old thread but not too sure if there was ever an answer provided.

 

 

@SiddhiFitbit As per the original post, "not interested in building a watch application, nor a Web application". 

 

@Wayne12345 Did you ever figure out how to use the API auth without registering an app?

Best Answer

Hi you can put anything in those fields - e.g. https://www.google.com - and it works! 


There's also options to specify if you'll use this access via the server, client, or personal!

Best Answer
0 Votes

Hi @reaperzn,

 

Welcome to the forums!

 

If you would like to download your own personal data to your computer without building a mobile/web application, you can use our Web API Explorer to fetch data from your account.

 

To do so:

  1. Click the link I provided
  2. Click 'Authorize' near the top right of the page to authorize Swagger UI to access your data.
  3. Log in to your Fitbit account, then authorize the scopes of data that you wish to read/write with Swagger UI.

Once you authorize Swagger UI, you can pull data using any of the GET endpoints or write data to your Fitbit account using POST endpoints. Responses are returned in JSON and you will be given the option to download the JSON response if you want to convert it into a CSV file.

 

Alternatively, you can also register a 'Personal' application at https://dev.fitbit.com/apps/new without creating an actual application. To see the quick start guide, click here. Since you are only pulling your own data, you can enter dummy values in the registration fields for your terms of service, privacy policy, etc. As for your callback URL, you can use localhost (meaning your local machine). You can then execute API calls using curl directly from your terminal/bash. 

 

I hope this helps. Let me know if you have any questions.

Best Answer

Hi John,

 

I'm currently working on my own data analysis based on data I pull from .CSV documents I download via the Fitbit website. Sadly the data is quite limited. Therefor I'd like to use the rest API.

 

I'm unable to proces .JSON information. Is there any App currently available to easily read the restdata of Fitbit? Such as activities, continued heartrate etc?

 

Please let me know!

 

- Marteijn

Best Answer
0 Votes

Hi @Marteijn,

 

Welcome to the forums!

 

Unfortunately, we don't offer any apps that allow you to download your data and convert the JSON response into CSV.

 

If you want to use the Web API, you'll need a client library to capture the JSON output. You can see a list of community examples here. Alternatively, you'll have to read the output through your terminal/bash console.

 

Can you let me know what type of data you are interested in seeing so that I can see if the Web API will be a good fit for your use case? 

 

Hope to hear from you soon! 

Best Answer

Morning @JohnFitbit ,

 

Thank you for your swift reply. 

 

I'm interested in my constant heartrate and daily exercises. I've heard I can get this data via the API.

I've tried to use one of the community examples as you stated. 

 

I followed the steps of one of the options (https://shishuinfo.home.blog/2016/06/16/how-to-download-your-fitbit-second-level-data-without-coding...

but sadly, I do not get past step 2 of the OAUTH 2.0 Toturial Page (on dev.fitbit.com). When I fill in the data it shows: Token response does not match the expected format; please check that you're using the correct OAuth 2.0 flow.

 

Can you help me with this part? Is this the easiest way to retrieve the exercise/HR data?

 

Thank you in advance!

 

Kind regards,

Marteijn

Best Answer
0 Votes

Hi @Marteijn,

 

I'd like to take a look at your application settings for reproduction purposes and see what may be throwing the error. Can you please PM me and send me a screenshot of your application settings? 

 

In the meantime, can you provide me with the steps you are taking in the oAuth 2.0 tutorial up until you reach this error?

 

I hope to hear from you soon!

Best Answer
0 Votes

Hi @JohnFitbit 

 

It doesn't let me upload files in a PM, the screen will go white and I can't send you the screen captures. I've tried it this morning and just tried it again, but it doesn't seem to be working. 

Best Answer
0 Votes

Hi Marteijn,

 

I am actually building a python module that will get all the data into a SQL data frame.

The data frame can be easily queried onto pandas df.

I'll post something here once it's online.

This is something I do on the side. Like some of us here, I like to play with my own data.

 

Best Answer

Hi @tlienart,

 

That sounds great! I'd like to do the same, but sadly I'm a total noob when it comes down to Python. 

 

Could you keep me updated about this module? I'd very much like to try it someday!

 

Regards,

Marteijn

Best Answer
0 Votes

Dear,

 

In your message you state that:

"

If you would like to download your own personal data to your computer without building a mobile/web application, you can use our Web API Explorer to fetch data from your account.

 

To do so:

  1. Click the link I provided
  2. Click 'Authorize' near the top right of the page to authorize Swagger UI to access your data.
  3. Log in to your Fitbit account, then authorize the scopes of data that you wish to read/write with Swagger UI."

 

When I click authorise, I am requested to provide a client ID.

Where may I find that Id?

 

Thanks

Best Answer
0 Votes