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

How can I push daily data to a Fitbit with API?

I'm trying to find out where to get started but in short, I'd like to push some data to my watch via API. 

My end goal is to build some type of app that has a company logo on it and has a set of daily data points to push to the user as a summary. 

Any tips or examples I can learn from would be appreciated. 

Best Answer
0 Votes
5 REPLIES 5

I think the Web API only lets you access data that has come FROM the watch; it doesn't let you push data TO the watch. The Device and Companion SDKs might be able to do what you want, although not easily: you can only use JavaScript fetch() or WebSockets.

Peter McLennan
Gondwana Software
Best Answer

Depending on what you mean by that, you can create activities using the API. the documentation is here: https://dev.fitbit.com/build/reference/web-api/activity/create-activity-log/.

However, here is an example in python: 
        self.session = OAuth2Session(CLIENT_ID, redirect_uri=REDIRECT_URI, scope=scope)
        querty_params = {'activityId': 90013, 'manualCalories': 300, 'startTime': '10:00', 'durationMillis': 360000, 'date': '{date_here}' 'distance': 0.5}

        response = self.session.post(f"https://api.fitbit.com/{endpoint}", query_params

note that this is using OAuth2Session and a very rough example that would require you to set up auth2. Here is a reference for setting that up:Let me know if you need any further help.
Best Answer

To get very specific of what I'm looking to do, is push or publish external sales data to my watch on a daily basis. This would give me an overview of some business metrics that are unique to me. This data I can get it through an API, or post it on a Google sheet which also has an API. 

From what I've researched the other way around this would be to publish an app in iOS and Android and connect notifications with this app. It might work but I'd rather see how I can build some type of API that pushes this data to the watch as a type of message. 

Best Answer
0 Votes

Thanks for the reply. I think I'm understanding the differences, might not be an easy thing of what I want to do but as long as it is possible then I'm going to want to pursue it. 

If I'm able to achieve my goal of pushing this data to a watch, I wonder if I can make this easier for other users to do the same where they connect their APIs to this new app so it can be pushed daily to their watch. 

Best Answer
0 Votes

Hi @hons00000 

As the others mentioned, you can push health and fitness data to a user's Fitbit account using the Web APIs.  The documentation for the Web API is https://dev.fitbit.com/build/reference/web-api/.  I'm not sure if you can sync Fitbit data from a user's account to the Fitbit device.   @Gondwana might be able to answer this.

However, you did mention you want to push external sales data to your watch on a daily basis.  I imagine you could do this using javascript and an API that transfers the data to the device.  Also, you would need to figure out how to display the data.   From my understanding, the Fitbit device's storage is limited so you'll need to keep in mind how much data can be stored or viewed in cache on the device.   I'm going to move this post to the Device SDK forum to see if others can help.  

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