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

Do we have any API to get Hourly Activity?

Hi,

 

I have tried retrieving Hourly Activity, but couldn't find any reference to get that.

Let me know if it is possible to add to watch face development.

 

Screenshot attached for reference.

AjaySingh_0-1595244005132.png

 

Best Answer
0 Votes
11 REPLIES 11
Best Answer
0 Votes

This only speaks of minute history and day history, have they added the much needed hourly history?

Best Answer
0 Votes

it doesn't really say if Hourly steps can be retrieved.

Best Answer
0 Votes

No, the API doesn't provide hourly history.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

You might want to vote for this feature suggestion:

 

https://community.fitbit.com/t5/Feature-Suggestions/Enable-developing-clock-faces-that-support-Remin...

 

I posted this over 2 years ago asking for this functionality.

 

John

Best Answer

Thanks, I voted for this.

Best Answer
0 Votes

This is a reprint from an earlier post but still valid...

 

Yeah,...my solution to recording hourly steps was to trigger a record every hour. If the user switched to something else, it pro-rates the accumulated steps to each hour that has passed after control is returned to the watch face. It's not perfect but usually close enough to determine if 250 steps were walked in each passing hour.

 

I did try the step history and it absolutely does work as explained, but the neither time frame available was helpful for recording hourly steps.

 

Regards,

Reign

Best Answer
0 Votes

I tried to use minute activity, but the results are empty records. Are there samples how to use the API?

Best Answer
0 Votes

There are examples here. I don't think the simulator simulates history (but I could be wrong).

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Hello AjaySingh,

 

If you would like to test (play around with) activity history,

here is a short example you can start with:

import {minuteHistory,dayHistory} from "user-activity"

let tHistory = dayHistory.query()

for (let index1 in tHistory){
  
  let tString = "index:" + index1 
  let tElements = tHistory[index1]
  
  for (let index2 in tElements){
    if (index2 != "constructor") tString += ", " + index2 + ":" + tElements[index2] 
  }
  console.log(tString)
}

 

Example result is: [11:58:59 AM]index:2, steps:29, distance:21, calories:4, floors:0, averageHeartRate:93, restingHeartRate:undefined

 

Note that minuteHistory is limited to 60 minutes, dayHistory is limited to 6 days.

The dayHistory format and minuteHistory format are basically the same.

 

dayHistory delivers simulated data in the simulator. minuteHistory does not; it delivers undefined values.

 

There is no hour history equivalent ...yet. It seems likely to follow a similar format if or when they do add it.

 

Regards,

Reign

Best Answer
0 Votes

Thank you Reign,

 

I will try playing with the code you have provided and submit back if find any better solution.

Best Answer
0 Votes