cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.

TCX comparison vs Stream/Lap data from api

jjtbsomhorst
Mt. Kenya

HI,

I'm currently looking into using the strava api to export my activities to Gpx/Tcx (or any other format that suits my needs) because Garmin doesn't offer such a service / api. When looking into the data and comparing an activity from Garmin, exported in TCX format, with the data I can collect using the streams/laps api I noticed a few things?

1. The start/endindex of the first lap sometimes seem to be 0? Why can this happend and how should I deal with this? Since the lenght of the lap corresponds with the length found in Strava/Garmin ui.

2. The endIndex of the last lap doesn't correspond with the last index in the stream data? F.i. 1980 for the size in the stream. 1956 in the lap data?

Can someone explain to me why this could happen? And how to work with it?

3 REPLIES 3

jerfe564
Mt. Kenya

I finally found the cause of the mistmatch: if the beginning or the end of the activity is hidden, data returned by laps endpoint is not aligned with the stream endpoint. 

So now the question is: how to massively modify visibility of the start and end to have good alignment?

SkippyVasquez
Moderator Moderator
Moderator

Hey Jitbsomhorst,

Can you explain more about what you are trying to achieve? In the meantime you can take a look at our reference guide on Streams.

Skippy
STRAVA | Developer Hub Team


Hi,

I encounter exactly the same strange thing: the END index ID of the last lap (end_index = 1270) does not match the count of the rows returned by the stream api (size = 1352). Based on the doc provided, index returned by the LAPS API should match with stream index but it is the case only sometimes...

I can see that stream API return also the field "resolution" (value = "High" in my case) but I do not see anything in the documentation. I suspect we should get stream data with another resolution to match the LAPS index?

PS: I just checked data returned by the Strava web app (that us the URL endpoint "$ID/lap_efforts") and for the same LAP ID, end_index is not the same than API but this time is correct (1351)