Swimming and biking activity details missing in aggregate api

Viewed 139

We are building application which requires integration with Google Fit Rest API. The requirement is to get detailed data of each activity of user. Currently, we can get activity details of user by calling "https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate" api with dataTypeName as "com.google.activity:segment". The api response only returns duration of activity instead of metric details like Calories, Distance etc.

In the response below, we have 2 activities 1 -> Biking, 82 -> Swimming being returned from request, however, the only metrics it contains is duration of Activity. Is there any api which can return calories burnt, distance covered for these set of activities?

Request:


  {
      "aggregateBy": [{
            "dataTypeName": "com.google.activity.segment"
       }],
       "bucketByTime": { "durationMillis": 86400000 },
       "startTimeMillis": 1591117200000,
       "endTimeMillis": 1591203599999
  }

Response:


{
  "bucket": [
    {
      "startTimeMillis": "1591117200000", 
      "endTimeMillis": "1591203599999", 
      "dataset": [
        {
          "dataSourceId": "derived:com.google.activity.summary:com.google.android.gms:aggregated", 
          "point": [
            {
              "startTimeNanos": "1591198680000000000", 
              "originDataSourceId": "raw:com.google.activity.segment:com.google.android.apps.fitness:user_input", 
              "endTimeNanos": "1591200480000000000", 
              "value": [
                {
                  "mapVal": [], 
                  "intVal": 1
                }, 
                {
                  "mapVal": [], 
                  "intVal": 1800000
                }, 
                {
                  "mapVal": [], 
                  "intVal": 1
                }
              ], 
              "dataTypeName": "com.google.activity.summary"
            }, 
            {
              "startTimeNanos": "1591191540000000000", 
              "originDataSourceId": "raw:com.google.activity.segment:com.google.android.apps.fitness:user_input", 
              "endTimeNanos": "1591193340000000000", 
              "value": [
                {
                  "mapVal": [], 
                  "intVal": 82
                }, 
                {
                  "mapVal": [], 
                  "intVal": 1800000
                }, 
                {
                  "mapVal": [], 
                  "intVal": 1
                }
              ], 
              "dataTypeName": "com.google.activity.summary"
            }
          ]
        }
      ]
    }
  ]
}
0 Answers
Related