Strava-From-Endomondo-Importer is the console application that imports data from Endomondo files to your Strava profile.
That's a quick-and-dirty application that I wrote for myself as a single run app, but decided to publish it, so you can use that for your import. It does support a lot and works gently with thousands a lot, but be aware about its limitations (see the Limitations section).
Check for the releases here: https://github.com/dariusz-wozniak/strava-from-endomondo-importer/releases
The main features of that lovely app are:
- Uploading activity does not affect Home Page, so it is not visible at the top of all activities (at Strava Home Page).
- Supports big amount of files. My Endomondo archive contained almost 4000 files and it works smoothly. The only limit is a daily API limit of 1000 calls. But, you can start the job the next day (clock resets at 0 UTC).
- Supports importing *.TCX files and sync with the Endomondo JSON files (optional).
- Supports custom mapping between activties.
- Supports retrying, so if you have reached maximum threshold of API calls in 15 minutes, it will make several retries.
- Build the small local database with the current state, so it continues the job after restarting the app.
Run the StravaFromEndomondoImporter.exe
with the following arguments:
-p, --path Required. Path to input TCX files and output files (JSON data store, log files).
--clientid Required. Strava client ID.
--clientsecret Required. Strava client secret.
-s, --skipscan Set to true if you want to skip scanning files.
-j, --jsonsync Scans for Endomondo JSON files for Strava vs. Endomondo activity type mismatches.
--help Display this help screen.
--version Display version information.
In order to get your client ID and client secret, you need to register an application at Strava.
-
For the form:
- Application Name: type whatever you want
- Category: Data Importer
- Website: any of website with valid URL
- Authorization Callback Domain: localhost
-
Next, you will need to provide any of image in the "Update App Icon" form.
-
And finally, you will get "My API Application" with all the details you will need, i.e. Client ID and Client Secret.
The app uses the following steps to import data:
-
Scan for *.TCX files in the path.
- Files state are being maintained in the local JSON data store (
endomondo-to-strava-data-store.json
). - If the
--skipscan
or-s
option is set, the app will not scan for .TCX files. That can be useful if the scan process was already done.
- Files state are being maintained in the local JSON data store (
-
The browser should be opened with Authorize option. Click on the Authorize button and then you will be redirected to the 404 localhost page. Copy the code from the page and paste it into the command line and then press Enter.
- For example, for URL:
http://localhost:80/strava_exchange_token?state=&code=123abcdef&scope=read,activity:write,activity:read_all,profile:read_all,read_all
Copy the
123abcdef
part and paste it into the command line. -
The app will try to process importing activities to Strava in the 3 steps:
- Upload activity to Strava.
- Update activity in the Strava.
- Adjust
sport_type
basing on the *.TCX file (if needed). - Set
gear_id
to null. This is becausegear_id
is being set to default one. - Set
hide_from_home
to true.
- Adjust
- Scan for Endomondo-specific *.JSON and adjust activity types.
- If there are any needs to update then it will happen.
- The state is maintained under its JSON data store (
endomondo-to-strava-data-sync-status.json
).
The app is very chatty and you may find it useful to see the logs. See -p
or --path
option for the path to the log files.
Strava API has a rate limit per API application:
The default rate limit allows 100 requests every 15 minutes, with up to 1,000 requests per day.
The app retries failed requests after 15 minutes, but doesn't look into daily limit, so you might need to close application manually or wait until throttling will be completed.
Access token lives for 6 hours and the app doesn't care about refreshing it. If the run is above 6 hrs., restart the app.
The app run on Windows only.
If you want to run it on another system, you need to modify the code. See BrowserRunner.cs
as the first class to modify -- there is a hint on how to modify it for Linux and Mac. If you successfully run the app on another OS, please do not hesitate to create a new Pull Request ๐
Mappings of activity types are personalized and adjusted to my needs. You might modify them as well.
See the following methods to modify:
StravaService.Map
EndomondoJsonSync.MapToStravaActivityTypeOrNull
The app is published as-is. The authors do not take any responsibility for losing or altering any of data.
See the LICENSE
file.
Logo has been generated by DALLยทE 2.