2

I'm developing a web application which requires to fetch user's steps count fromt Google Fit periodically. I went through the API docs and found the REST End Point : https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate which gives the steps count. I'm passing the data to this POST end point in below format.

{
    "aggregateBy": [
        {
            "dataTypeName": "com.google.step_count.delta",
            "dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"
        }
    ],
    "bucketByTime": {
        "durationMillis": 86400000
    },
    "startTimeMillis": 1630568107871,
    "endTimeMillis": 1630571402415
} 

The steps count returned from the above request is different from the ones showing in my Google Fit app. I tried searching this for days but didn't found anything. How can I get the correct steps from this API as shown on the Google Fit app

Divyansh
  • 41
  • 5
  • Try the answer in FAQ https://developers.google.com/fit/faq#how_do_i_get_the_same_values_step_count_calories_distance_etc_as_the_google_fit_app seems related to this one. – Arel Guatno Jun 01 '22 at 14:44

0 Answers0