As many people around the world I like to do some exercise now and then, and when that exercise is running I save all my workouts to Endomondo. I have been doing this for over two years now, and have accumulated more than 300 workouts.
Recently Endomondo decided to limit the amount of features available for free, and move them to a subscription part of the website. While I have no problems with paying for what I use, I consider it a bad move to start charging for features that used to be free. It doesn’t really affect me that much though, since I never used those features anyway. However, it got me thinking that should Endomondo decide to do something similar in the future, I won’t have the option to switch platform since they hold all my workout data. There is a possibility to export one workout at a time, but Endomondo clearly stated that a mass export function will not be available.
I was not satisfied by this so I wrote a script to export all my workouts from Endomondo, and I am posting it here in case some of you want to get all your data back from Endomondo too. After all it’s YOUR data.
The script is written in PHP and runs from the command line. For Windows I have put everything needed into a single file. For Linux and OSX you need to install PHP yourself. Also, in order for the script to work you need to login in one of the following ways:
- Put your username and password in a file called secret.txt where the first line is the username and the second line is the password. This does not work with Facebook logins and also requires OpenSSL support in your PHP installation.
- Get the cookie used to authenticate you and put the cookie (everything after “Cookie: ” or the entire line, it doesn’t matter) in a file called cookie.txt. You can get the cookie in several ways: With Wireshark, using Chrome: (F12, reload page in Endomondo, Network, click on one of the resources under headers) or with some extension like TamperData for Firefox.
If both files exist, username and password authentication takes priority.
The script will first download a list of all your workouts, then download the actual workouts. It will remember the the latest workout that was downloaded, so if you run it again at a later point in time, you will only get new workouts. You can modify the function generateFileName to change the filenames of the saved workouts.
Disclaimer: This script worked for me. Endomondo can easily change something on their website so this script does not work anymore, so I offer no guarantee that it will work for you. Use this script at your own risk.
You can download the script for Linux and OSX or you can download everything needed to run it under Windows. If you’re using Windows you should extract the Endomondo directory from the ZIP file and execute the file run.cmd. For any other OS you should just execute php getworkouts.php.