Can not get calories param from Strava API Response

285 views
Skip to first unread message

Andrey Vorobev

unread,
Jun 22, 2021, 9:56:26 AM6/22/21
to Strava API
Hi everyone.
I am a developer and I am using Strava API.
Now I want to add calories param on my side. I saw this param in developers API doc
https://developers.strava.com/docs/reference/#api-Activities-getLoggedInAthleteActivities
 but I did not see this param in response from Strava API.
Could you help me please with this?

Example data from API:
0 => {#1808
+"resource_state": 2
+"athlete": {#1994
+"id": 27983746
+"resource_state": 1
}
+"name": "Дневной забег"
+"distance": 27.1
+"moving_time": 13
+"elapsed_time": 94
+"total_elevation_gain": 0.0
+"type": "Run"
+"workout_type": 0
+"id": 5473015671
+"external_id": "702c1729-b440-4d69-90d1-dfd349359cb4-activity.fit"
+"upload_id": 5826330418
+"start_date": "2021-06-15T10:51:43Z"
+"start_date_local": "2021-06-15T13:51:43Z"
+"timezone": "(GMT+02:00) Europe/Kiev"
+"utc_offset": 10800.0
+"start_latlng": array:2 [
0 => 49.989483
1 => 36.219056
]
+"end_latlng": array:2 [
0 => 49.989473
1 => 36.219083
]
+"location_city": null
+"location_state": null
+"location_country": null
+"start_latitude": 49.989483
+"start_longitude": 36.219056
+"achievement_count": 0
+"kudos_count": 0
+"comment_count": 0
+"athlete_count": 1
+"photo_count": 0
+"map": {#2105
+"id": "a5473015671"
+"summary_polyline": ""
+"resource_state": 2
}
+"trainer": false
+"commute": false
+"manual": false
+"private": false
+"visibility": "everyone"
+"flagged": false
+"gear_id": null
+"from_accepted_tag": false
+"upload_id_str": "5826330418"
+"average_speed": 2.085
+"max_speed": 1.6
+"has_heartrate": false
+"heartrate_opt_out": false
+"display_hide_heartrate_option": false
+"elev_high": 106.5
+"elev_low": 106.5
+"pr_count": 0
+"total_photo_count": 0
+"has_kudoed": false
}

kingo...@gmail.com

unread,
Jun 22, 2021, 10:41:39 AM6/22/21
to Strava API

> An array of SummaryActivity objects.

and a SummaryActivity object does not have a calories field.

If you want calories you need a DetailedActivity object in your response so you need to use a different API method. This is all in the docs.

Andrey Vorobev

unread,
Jun 23, 2021, 2:39:45 PM6/23/21
to Strava API
Thanks for the answer. Will try to use "DetailedActivity" API call.
Reply all
Reply to author
Forward
0 new messages