I'm trying to extract data from various silos in preparation for posting them here. This morning I looking for ways to download my run history from MapMyRun. MapMyRun has a feature to get a CSV of all workout summaries (https://www.mapmyrun.com/workout/export/csv) and it has a feature to download a TCX file for a single workout with GPS points, etc. However, there is no option to download everything all together.

The CSV has a link to the workout page for each workout, which includes the workout ID. The TCX download URL also takes a workout ID. If we put these together we can download everything in one go:

  1. Sign into MapMyRun, open the developer console, go to the network tab and reload the page.
  2. Right-click the page load request and Copy -> Copy as cURL. Stick this in a file called curl.sh and replace the URL with $1. This gives us all the cookies we need to load the page.
  3. Run the script below to get a TCX file for each workout.

#!/bin/sh
for ID in $(./curl.sh https://www.mapmyrun.com/workout/export/csv|cut -d, -f17|tr -d "\r"|cut -d/ -f5); do
    echo $ID
    ./curl.sh https://www.mapmyrun.com/workout/export/$ID/tcx > ${ID}.tcx
done