How to Export Strava Workout Data

If you’re a numbers geek AND a fitness geek like me, you’ve wanted to export Strava data. You’ve realized with dismay that Strava doesn’t have any kind of export function for the hard-earned workouts you’ve uploaded. Normally the lack of a feature like this wouldn’t cramp my style, but I really wanted to summarize my preparation for Cayuga Trails 50.

Training infographic (click for full details)

Going through workout-by-workout just wouldn’t cut it. I needed a spreadsheet I could sort, filter and enrich. The resulting poster was just as I’d hoped for! It turns out I’m also a technology geek, so I figured out how to export Strava data into a spreadsheet so I could get the numbers I needed for my poster. There are a few steps involved, but it’s not THAT hard. Grab a cold one and get your browser console ready, ’cause we’re going to go on a Strava data expedition!

Note: An astute reader pointed out that Strava already had an export feature. True! Go to profile settings and you’ll see “Download your data” in the right column. However, that downloads only a zip file of your owrkouts in GPX format. It doesn’t supply a single spreadsheet view with oodles of data, which is what I was after. True, Strava provides a developer API, but that’s a bit heavy-handed for a single query. All API-based plugins or add-ons that I tried while researching this post did not work for my use case; they either didn’t work at all, didn’t have all the columns I needed, or only exported a certain number of workouts.

Step 1: The Browser Console

Open up your browser console. I’m going to show you this in Chrome, which is how I’d do this, but if you use Firefox or (shudder) Internet Explorer, you can do this there, too. Right-click anywhere on the web page and click Inspect.

This will load the inspector at the bottom of your browser, looking something like this:

Frightened yet? Don’t be.

In the inspector, there are navigation options along the top. Click Network. Below that, you can filter network traffic by type. We’re looking for XHR, so click that. Now, any data request the browser makes back to the server will be summarized here. Who knew browsers could show you such cool stuff?

Step 2: Go to Strava’s My Activities Page

Go to Training > My Activities. You get a nice tabular view of your workouts, right? Unfortunately Strava will only let you see 20 activities at a time, but you can filter by sport type and search by keyword. If you want to use these filters before you export your data, so you get a subset of your workouts, now is the time to use them.

Your inspector should now look like this:

Step 3: Export Strava Data

Web pages can make a lot of requests in the background for data. In this case, we’re looking for one called training_activities. In the upper left corner, under that red dot, you can search for “training” and see just those requests, which is what we’re looking for.

Click the first request in the list. This is the request/response for the first 20 workouts in your list. On the right side, you can see a preview of the response for the data.

Above that data on the right side, click on “Response” to see the raw data.

Click anywhere in that raw data (that pretty red and blue text), hit Ctrl-A to select all of it, and then Ctrl-C to copy it to your clipboard. The data’s in what’s called JSON format, and we need to get it into another format so we can import it into the spreadsheet of our choice. Open a new tab (don’t leave the Strava tab, ’cause we have more work to do!) A quick Google search for “convert JSON to CSV” gives me a result of from convertcsv.com, which is exactly what I need. Paste the JSON text you copied into the text box on their page and click “Convert JSON to CSV”. From there, you can download the result, or if you’re a Microsoft person, you can also click JSON to Excel.

Now we can go back to our Strava tab, scroll to the bottom of the 20 workouts shown in the actual web page, and click the Next button to view the next set.

When you do this, you’ll see another XHR request in the inspector. This time, it’s requesting workouts 21-40, whereas the first time, it was workouts 1-20. It’d be easier if Strava let you change the results per page to something other than 20, but it doesn’t. Believe me: I checked. Now you’ll see another response below the first one.

Repeat the steps to copy the result and convert it from JSON to CSV or Excel. Keep on going, and your Network panel will look something like this, chock full of good data:

Once you’re finished, if you’ve gone the Excel route, it’s a matter of copy/pasting from each spreadsheet into a master spreadsheet. If you’ve done CSV, you can do the same in your text editor, grouping all the CSV files into one, or import each into your spreadsheet of choice and manipulating the data from there. If you’re a Windows user and feeling particularly brave, you can also follow Tom Nash’s instructions on combining CSV files automatically.

Conclusion

I can only hope that Murphy’s Law applies here, and after thoughtfully writing this post, Strava releases an update that’ll let you export Strava data natively. Until then, happy data mining, and happy running/cycling!

Great idea! Expanding on it, here is an alternative solution for those too lazy to repeat the steps for every 20 activities.

I noticed that in the second page, the training_activities URL finished by &page=2&per_page=20. Which made me think this could be scriptable (but only in the browser and session context). Googling a few ideas on how to do that made me learn that you can right click an XHR call in the browser inspector, then Copy / Copy as cURL. You can then paste the result in a bash window to download the JSON. So I created a quick shell script that looks like this:

Very nice.
I’d also like to be able to export “Recent Efforts” for any given Strava segment. I guess that information must be exportable in a similar fashion?
Are you able to show how? I’m afraid that I’m only competent at following guidance – not geek enough to work it out for myself.

Hi Scott,
You did put a lot of effort but this is just a bit too complex for me…
However to download one activity to excel i use the following trick
1/ export the activity as a tcx file and then open it in xl
to export as a tcx, just add ‘export_tcx’ to your activity [example:https://www.strava.com/activities/1252160/export_tcx%5D and strava will pop up a window for saving the file.

Thank you, Scott! Not only was I able to transfer my data into excel with ease, but I also finally downloaded and made chrome my default browser. No easy task to make a task such as this simple. Do you know if strava has made any move to making the data more accessible to us number lovers?

Thank you so much! I’m starting a data analytics program (mid-career pivot from a STEM field but no coding experience and minimal html experience) and we have to introduce ourselves through data visualization for the first class. I wanted to visualize my Strava data and was frustrated when it didn’t seem clear cut how to get it. This was PERFECT and I’m so psyched to play with this data now! Thank you!

I’m so happy to hear this! Every time I hear about somebody having a good experience with the instructions, I’m glad I wrote it up. Best of luck with your data visualization! If you have something to share after you do it, I would love to see it.

True, but that’s not what this article is about. They still don’t support exporting a data file that summarizes your activities as it does on-screen. That’s the data you need to summarize a year of working out, for example.

Hi Scott and readers, I wrote a small web tool using the official Strava API to generate an Excel report off all activities. This might save you some json downloading by hand. Bulk json download for all activities is also implemented. It can be found here: https://entorb.net/strava/ Best Torben

Torben – this is wonderful, thanks. This is something that *should* be available somewhere and I wasn’t able to find it until now. Also, I’m a fellow perl coder so it makes me happy to see such useful work performed w/ perl

Open strava
Go to “Training/My Activities”
Open Chrome’s console window
Set max. page number to (Activities/20 +1)
Copy script bellow into console
Run (press enter)
When finished copy the new window’s content into this page edit windowhttps://konklone.io/json/
Follow the page’s instructions
Enjoy!
*/

I just tested Tibor’s code and it works! The onl issue I hit was that the CMS (wordpress?) decided to change simple quotes from ” to fancy quotes ( ” ) . If you replace all of the higher ordered (unicode?) versions ( ” ) with the standards ascii ones ( ” ) the code runs fine. If you don’t then my interpreter cried foul with an invalid token error.

Richard, A friend of mine created http://www.stravabestefforts.com and I am working with him now to be able to extract average heart rate data for each split. His program already does a lot but heart rate data will make it even more valuable.