Is there a way to export bulk data to TCX or GPX files? Seems like I can only bulk export to .csv and individual activities to GPX.

I'm looking for a way to import all of my activities from Garmin into Strava.  I see a bulk export option, but it only seems to allow for .csv exports.  I want the GPX data.  My accounts are linked but it only imported from the date of Strava account creation and onward.

Thanks,

Mike

Top Replies

All Replies

  • Can you sync from TrainingPeaks to Strava?  TrainingPeaks will sync with all activities from the beginning of time.

  •   I think the easiest way to sync (more than 30 days) from Garmin to Strava is this free service:

    https://tapiriik.com/

    For less than 30 days, and for all your future activities, you can just link your Garmin and Strava accounts normally.

    If you really want to bulk export your files for safekeeping, then I recommend this script:

    https://github.com/pe-st/garmin-connect-export

    You'll need a computer as it's a python script, but it allows bulk export of all your activities to FIT ("original"), GPX or TCX. If you have a Windows PC, you'll need to grab Python at https://www.python.org/downloads/. Macs have python installed out of the box.

  • Check this solution.Works perfect for me:
    blog.ps-sports.de/.../

    /*
    Here's javascript that can be run in any modern browser fairly simply in javascript. Might be easier to set up than Python.

    You'll want to pre-set a download location in your browser settings to some folder, name it TCX or something, and tell your browser to auto-download there, or else you'll get a ton of popup save dialogs.

    First Navigate to the last (most recent) activity you have in Garmin Connect (as in connect.garmin.com/.../5555555555 ), then hit F12 (should work in chrome/IE) to open dev tools to get to the Javascript Console. Then paste the below code and hit enter to run it. Can change ttl from 100 to whatever # of activities you want to download.
    If you want a different format, change the "tcx" part of the URL to the appropriate format acronym if garmin supports it.
    If your connection is too slow to do a full download in less than 3 seconds every time, change the downloadTimeoutLength from 3 * 1000 to whatever number you want (it's 3*1000 because that's 3000 milliseconds = 3 seconds).

    [CODE]*/
    var a = window.location.pathname.split("/");
    var id = a[a.length-1];
    var tcxUrl = "https://connect.garmin.com/modern/proxy/download-service/export/tcx/activity/";
    var cnt = 1, ttl = 100; /*Change ttl from 100 to whatever # of activities you want to download*/
    var downloadTimeoutLength = 3 * 1000;
    var downloadUrl = tcxUrl + id;
    window.location.href = downloadUrl;
     
    setTimeout(
       (getMore = function(){
        jQuery.getJSON("https://connect.garmin.com/modern/proxy/activity-service/activity/"+id+"/relative?_="+Math.random()
            ,function(d){
                id = d.previousActivityId;
                downloadUrl = tcxUrl + id;
                window.location.href = downloadUrl;
                if(++cnt<ttl){
                    setTimeout(getMore,downloadTimeoutLength );
                }
            }
        );
       })
       ,downloadTimeoutLength
    );
    /*[/CODE]

    It goes from most recent back downloading each one. If you don't put the right total # to download them all, just navigate to the last one it got and re-run from there.*/

  • To paste some code, use the Insert Code option, it will be more readable.

     

    And I also made similar script.

    All activities can be downloaded using this script: Show all routes on the same map / 930931.

     

    Download link in the script can be modified for FIT or GPX or TCX file:

    • connect.garmin.com/modern/proxy/download-service/files/activity/
    • connect.garmin.com/modern/proxy/download-service/export/gpx/activity/
    • connect.garmin.com/modern/proxy/download-service/export/tcx/activity/
  • Thanks much, this is excellent!  It doesn't run with a direct copy/paste, I suspect some quotes or something got messed up.  Is there any chance you could re-post in a way that doesn't goof up your code? 

  • @BunBun! your script linked above (here) worked great!  I copy/paste to the console and it ran nice.  I think the problem with @Limak74 code is just the forum is displaying it wrong since it's not in a code block.  

  • Is there a way where you can tell it to start from a given activity. I left it running and my Garmin log-in timed out. The code works well but wants to start from the latest activity each time.

  • Is there a way where you can tell it to start from a given activity. I left it running and my Garmin log-in timed out. The code works well but wants to start from the latest activity each time.

    Yes, just add the &start parameter, for example this will start from 201th activity (counting from latest):

    .../search/activities?limit=200&start=200

    It's normal search link, so it will also accept all filters visible on the website, so you can add also:

    &activityType=running&startDate=2019-12-31&endDate=2020-01-2

  • In case anyone comes here looking for a solution, I wrote an extension that handles the Strava half of this question.  My extension supports bulk upload of activities beyond the 25 at a time that Strava currently supports:.

    Chrome/Brave/Opera/Chromium Edge: https://chrome.google.com/webstore/detail/strviewer-for-strava/ngfoaejpgecfdfbdedlednkfdbniplik

    Firefox: https://addons.mozilla.org/en-US/firefox/addon/straviewer-for-strava/