Last active
May 21, 2025 19:19
-
-
Save scottpdawson/74f85f60a7cf7fcc8ee527592dadf498 to your computer and use it in GitHub Desktop.
Bulk download Strava activities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxPage = 25; // calculate this using (activities/20 + 1) | |
var activityType = "Run"; // change to the workout type you want, or blank for all | |
var p = 1; | |
var done = 0; | |
var url; | |
var nw = window.open("workouts.html"); | |
nw.document.write("["); | |
while (p <= maxPage) { | |
url = "https://www.strava.com/athlete/training_activities" + | |
"?keywords=&activity_type=" + activityType + "&workout_type=&commute=&private_activities=" + | |
"&trainer=&gear=&new_activity_only=false" + | |
"&page=" + p + "&per_page=20"; | |
jQuery.ajax({ | |
url: url, | |
dataType: "json", | |
method: "GET", | |
success: function(data, textStatus, jqXHR) { | |
for (i in data.models) { | |
nw.document.write(JSON.stringify(data.models[i]) + "," + ""); | |
} | |
done++; | |
if (done >= maxPage) { | |
nw.document.write("]"); | |
nw.document.close(); | |
} | |
window.open("workouts.html"); | |
} | |
}); | |
p++; | |
}; | |
window.open("workouts.html"); |
It worked perfectly, thank you !!!
Thank you so much for this!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The JSON terminated after 300 activities, so I used https://github.com/liskin/strava-offline instead using
strava-offline sqlite
.