banner



How Do I Upload Tcx To Strava?

Exporting your activities from Endomondo to Strava

On October 30th Endomondo announced they would be shutting downwards their service on 31st December 2020 and the information would be permanently deleted later on March 31, 2021.

The aim of this tutorial is to show you how to export your data from Endomondo then import them to Strava. In fact, it's something I've been doing myself over Saturday morning time.

There are 3 ways to practise it I know of:
1. Using Tapiriik service, which should practise information technology automatically over time.
two. The manual manner, which may be perfect if you have a pretty minor number of records to motion.
iii. Automatic way for a huge number of files, which is likewise the near complex, but I'll guide you through it step by step.

Tapiriik

This one is pretty simple, you become to the https://tapiriik.com/ website, qualify both Strava and Endomondo and allow the service to sync data in the groundwork.

Some people say information technology takes a lot of fourth dimension with a complimentary tier and speeds up after donation. I haven't tried it myself though.

The transmission synchronization

You tin can request data export from Endomondo, which is described in this commodity: https://support.endomondo.com/hc/en-us/articles/360006081933

Basically, you but go to https://www.endomondo.com/settings/account, click the button under the "Export and Download Your Data" department and the annal will be prepared in the groundwork. Once complete, you lot should receive an email with a download link.

After unzipping you should get and bank check the Workouts subdirectory as information technology contains all your recorded routes.

Uploading to Strava happens in https://world wide web.strava.com/upload/select where you can navigate after selecting the tiptop-right "+" button and "Upload activeness".

That style yous can upload up to 25 .tcx files at once.

Automated way — the funniest fashion! 🎉

The steps needed to complete the process are:
i. Export all the recorded routes from Endomondo to a universal format, east.g. .gpx files — we saw it before only why not do it automatically?
2. Enable API access on Strava.
iii. Upload all the files in batches of 100 at once (Strava API limits).

Exporting activities data as .gpx files

I used endomondo-api-handler library to consign all my data. My code is a unproblematic node.js project with 2 files:

Relieve them on your local disk, due east.m. in the exporter directory, replacing YOUR_ENDOMONDO_EMAIL and YOUR_ENDOMONDO_PASSWORD with your credentials. Also, create gpx directory inside — this is where the files will be stored.

Later that all you lot need to do is get to the console, navigate to the exporter directory and run a couple of commands:

          >mkdir gpx #if yous haven't done it manually
>npm install
>node exporter.js

If all goes well you lot'll come across the log of activities getting exported and gpx subdirectory getting filled with all the routes.

In the beginning, the script failed for me, when I debugged it, it turned out at that place was a problem with my countersign, most likely information technology was not properly used by the library as it was a very secure i (long, with all possible combinations). The workaround was to temporarily change Endomondo countersign to something easier, download the data, and modify it back to the previous, safe ane.

Getting API access in Strava

This is probably the almost catchy section, only if you become that far you should be able to do information technology! Allow's get-go.

Kickoff, y'all need to register a new awarding hither https://www.strava.com/settings/api, I called my — GPX importer.

You set up an icon and the nigh important thing — y'all set "Authorization Callback Domain" as localhost

Afterwards all of this is done you should have a configuration similar to this i:

Strava uses OAuth in order to give access to specific resource. We will need to make a Go and then a POST request to get a proper API token.

First let's make a GET request using the browser and then that OAuth flow can redirect us to localhost (parameter redirect_uri). We'll be requesting activity:write permissions.

The request is equally follows — you need to supersede YOUR_CLIENT_ID with "Client ID" from your Strava app summary:

https://www.strava.com/oauth/mobile/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost&response_type=code&approval_prompt=automobile&scope=activity%3Awrite%2Cread&state=test

The second y'all run it in your browser you'll get an fault saying y'all tin can't connect to localhost… which is great news! All you demand to practise is to extract code= parameter for the 2nd request.

At present, the last affair to practise to get a proper token is to build and run that control:

          curl -X POST https://www.strava.com/api/v3/oauth/token \
-d client_id=12345 \
-d client_secret=abcdefghijklmnopqrstuvwxyz \
-d lawmaking=YOUR_CODEabcdefghijk... \
-d grant_type=authorization_code

Once information technology runs successfully you should go a response similar to this ane

          {"token_type":"Bearer","expires_at":1604159396,"expires_in":21600,"refresh_token":"RFTOKEN","access_token":"ACCESS_TOKEN","athlete":{"id":ABC,"username":"","resource_state":two,"firstname":"Kamil","lastname":"Burczyk"}}        

And ACCESS_TOKEN is the holy grail we were fighting for! 🎉

You might have noticed during Strava app configuration the Charge per unit Limits of 100 requests. Each unmarried gpx file upload is actually 1 request. So we're going to employ a script that imports our files in batches of 100 and moves them to gpx-done folder. The just thing to do is to put your ACCESS_TOKEN.

Save a file, add execution rights and run it as many times equally you need to bleed your files count to 0 (a multitude of 100).

          >mkdir gpx-done
>chmod +x uploader.sh
>./uploader.sh

After a batch of 100 files is uploaded, await 15 minutes and run script again.

You tin really find your API usage hither: https://www.strava.com/settings/api

Afterward all of this, you tin bank check if your activities uploaded successfully: https://www.strava.com/athlete/training

For me, later on six runs it's all there!

Hope you found information technology useful and all your activities are saved! :)

Source: https://kamilburczyk.medium.com/exporting-your-activities-from-endomondo-to-strava-682c23391041

Posted by: volkertthaveng1970.blogspot.com

0 Response to "How Do I Upload Tcx To Strava?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel