1

I can now retrieve step count data from Google Fitness REST API. https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate

However, I can't tell which data is reliable (data not generate by user input). After some research I found there is a orginalDataSourceId in document https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets#resource

But the description say

WARNING: do not rely on this field for anything other than debugging. The value of this field, if it is set at all, is an implementation detail and is not guaranteed to remain consistent.

So I really don't know how to do. How do I filter out step count that user input manually from Google Fitness REST API?

Farl Lee
  • 11
  • 6

1 Answers1

0

I found a solution now. The originDataSourceId of dataset is not reliable when you get by aggregate. (You may get data that merged from differnt source)

So you can get the data source list first. https://developers.google.com/fit/rest/v1/reference/users/dataSources/list

You can filter the Data Source by dataTypeName, device, ... etc. Then you can use the dataStreamId of the Data Source as dataSourceId to aggregate data. https://developers.google.com/fit/rest/v1/reference/users/dataset/aggregate (aggregateBy)

Farl Lee
  • 11
  • 6