Skip to main content

Hello, the following API appears to no longer be returning latlng.  I believe I ran this same URL a few weeks ago and did receive latlng in the results.

“https://www.strava.com/api/v3/activities/<ACTIVITY_ID>/streams?access_token=<ACCESS_TOKEN>&keys=time,latlng&key_by_type=true”

 

When I convert the response to json, the structure of the response appears as follows (I put in the “...”)

{'distance': {'data': 0.0, 0.0, 9.2, ... 4438.1, 4440.6], 'series_type': 'distance', 'original_size': 246, 'resolution': 'high'}, 'time': {'data': 0, 1, 10, ... 1550, 1551], 'series_type': 'distance', 'original_size': 246, 'resolution': 'high'}}

 

Previously, the response string included a section that was structured as follows (but with actual lat/lon pairs):

'latlng': {'data': : 0.0, 0.0], 00.0, 0.0], 00.0, 0.0] … 00.0, 0.0], 0.0, 0.0]}...

 

Is this a bug, did I miss an API change, or perhaps did I change something in my code without realizing it?

 

Thank you in advance for any assistance.

 

Definitely a bug


@da2999047 Donald, Thanks.  Today, I also confirmed even the Swagger UI is not returning latlng when I select all possible key options.

 

Are there any known workarounds (I need the lat / lon coordinates for approximately every second during the run)?

 

What is the process to get this bug fixed?  Does the Strava dev team pick up on this thread and fix the issue, or do I need to report it in a bug system somewhere else?  (I’m new to the community.) 

latlng is critical to my project and I would expect is a very important for others.


For me it works correctly, but I always use the time series_type instead of the distance series_type.


@Jan_Mantau, thank you for the details.  After taking your response, I troubleshooted further and found my API call sometimes works and sometimes doesn’t work.

 

1) WHAT DOES WORK:

Calling the activity stream API appears to work normally when the <ACTIVITY_ID> used contains non-empty values for sstart_latlng] and ]end_latlng] in the activity details.

 

2) WHAT DOESN’T WORKS:

I first calling the activities API call (to return all activities), getting an <ACTIVITY_ID>, and then calling the activity stream API call using that id (to return all lat/lon for that single activity).  It seems the <ACTIVITY_ID> I was  using using had empty values (“t]”) in the start_latlng] and aend_latlng] fields.

 

It appears the activities recorded with a Garmin watch did not populate the lat/lon values; this is a different issue which I will look into separately.

It seems my specification of “keys=distance,latlng” vs “keys=time,latlng” in the URL made no difference and is unrelated to the underlying cause of my issue (thank you, ​@Jan_Mantau  for confirming the call was working for you).


@rc100 I didn’t mean to use other keys, but another series_type. This won’t make any difference for you when the problem is missing data in the recording (recorded as indoor?), I only want to clarify that I use a URL like api/v3/activities/2250402881/streams?keys=latlng,distance,altitude,velocity_smooth,heartrate,cadence,watts,temp,moving,grade_smooth&key_by_type="&series_type=time

 


It appears the activities recorded with a Garmin watch did not populate the lat/lon values; this is a different issue which I will look into separately.

My first guess would be that some activity types (e.g. Strength, Yoga, etc) do not record GPS coordinates which is why there is no data for those.

The other thought is that the activity does have data but it all falls within the user’s privacy zone(s) and therefore isn’t visible to you.


Reply