Skip to main content
Question

Export activities .tcx files using the api


Forum|alt.badge.img

Hello,

 

The Strava website provides a convenient way to get the .tcx files of a specific activity:

https://support.strava.com/hc/en-us/articles/216918437-Exporting-your-Data-and-Bulk-Export#h_01GDP2C5E3278KM8MPK5X49ED3

This is a little-known trick, however, it's simple to use.  Simply add "/export_tcx" - without quotes - to the end of your activity page URL. For example, if your activity page is www.strava.com/activities/2865391236 - just add the text to give you  www.strava.com/activities/2865391236/export_tcx and hit enter. This will download a TCX version of your file to the location specified by your browser's preferences

 

Is there a way to achieve this with the API? I can get .tcx file for routes but not for activities.

Thanks for your help!

2 replies

ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • 240 replies
  • March 25, 2025

Directly, there is no API call that I know of.

Indirectly, you could use getActivityStreams to retrieve the various streams for the file you care about and then create your own tcx file. I haven’t searched but I expect there are libraries around for most major programming languages to make creating the file easier.

TCX schema: https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd


Forum|alt.badge.img
  • Author
  • Hub Rookie
  • 1 reply
  • March 26, 2025
ActivityFix wrote:

Directly, there is no API call that I know of.

Indirectly, you could use getActivityStreams to retrieve the various streams for the file you care about and then create your own tcx file. I haven’t searched but I expect there are libraries around for most major programming languages to make creating the file easier.

TCX schema: https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd

Hello ActivityFix and thank you for you answer!

In my mid getActivityStreams was corresponding to a currently happening activity. Is it also available for past activities?

Thank you!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings