Skip to content

Latest commit

 

History

History
126 lines (86 loc) · 4.5 KB

File metadata and controls

126 lines (86 loc) · 4.5 KB

Runtastic to Strava Migration

Migrate your Runtastic (adidas Running) activity history to Strava, including GPS routes, activity types, and metadata.

What it does

  • Uploads GPX files to Strava with correct activity types (run, ride, hike, etc.)
  • Falls back to manual activity creation for sessions without GPS data
  • Maps Runtastic's sport type IDs to Strava activity types
  • Includes metadata in descriptions (heart rate, calories, elevation, feeling)
  • Handles Strava API rate limits automatically (pauses and resumes)
  • Tracks progress to a file — safe to interrupt and re-run
  • Filters out indoor gym activities (pushups, situps, etc.) by default

What gets uploaded

The script uploads outdoor and sport activities: runs, trail runs, rides, hikes, walks, swims, skiing, snowboarding, rock climbing, bouldering, kayaking, surfing, and more. Indoor gym exercises are skipped by default. You can customise this by editing the ALLOWED_STRAVA_TYPES set in the script.

Prerequisites

  • Python 3.7+
  • A Strava account
  • Your Runtastic data export (see below)

Setup

1. Export your Runtastic data

  1. Go to runtastic.com, log in
  2. Navigate to Account & Data
  3. Click Export Data
  4. Wait for the email (can take up to 5 business days)
  5. Download and extract the zip archive

The extracted folder should contain a Sport-sessions/ directory with JSON files and a GPS-data/ subfolder with GPX files.

2. Create a Strava API application

  1. Go to strava.com/settings/api
  2. Create an application with these settings:
    • Application Name: anything (e.g., "Runtastic Migration")
    • Category: anything
    • Website: any valid URL
    • Authorization Callback Domain: localhost:8080
  3. Note your Client ID and Client Secret

3. Get an access token

Visit this URL in your browser (replace CLIENT_ID):

https://www.strava.com/oauth/authorize?client_id=CLIENT_ID&response_type=code&redirect_uri=http://localhost:8080&approval_prompt=force&scope=activity:write

Click Authorize. You'll be redirected to localhost (the page won't load — that's expected). Copy the code parameter from the URL in your browser's address bar.

Exchange it for an access token:

curl -X POST https://www.strava.com/api/v3/oauth/token \
  -d client_id=CLIENT_ID \
  -d client_secret=CLIENT_SECRET \
  -d code=CODE \
  -d grant_type=authorization_code

Copy the access_token from the JSON response. It expires after 6 hours.

4. Install dependencies

python3 -m venv venv
source venv/bin/activate
pip install requests

5. Run the migration

python3 runtastic_to_strava.py YOUR_ACCESS_TOKEN /path/to/runtastic-export

Where /path/to/runtastic-export is the extracted folder containing the Sport-sessions/ directory.

Rate limits

The Strava API allows 100 requests per 15 minutes and 1,000 per day. The script handles this automatically — it pauses when approaching the limit and resumes after the cooldown. A typical export of ~400 GPS activities takes about 2 hours.

If the script is interrupted (Ctrl+C, token expiry, network issues), just re-run the same command. Progress is saved to migration_progress.json and already-uploaded activities are skipped.

Customisation

Changing which activities are uploaded

Edit the ALLOWED_STRAVA_TYPES set near the top of the script. For example, to also include yoga and weight training:

ALLOWED_STRAVA_TYPES = {
    "Run",
    "Ride",
    "Hike",
    # ... existing types ...
    "Yoga",
    "WeightTraining",
}

Activity type mapping

The SPORT_TYPE_MAP dictionary maps Runtastic's sport_type_id values to Strava activity types. The full list of Runtastic sport type IDs can be found in the data export's data_information.pdf. If a mapping is wrong for your use case, edit the dictionary directly.

Files generated

  • migration_progress.json — tracks which sessions have been processed (safe to delete to start over)
  • migration.log — full log of all uploads, errors, and skipped activities

Limitations

  • GPS routes are only available if the original activity was tracked with GPS
  • Heart rate data embedded in GPX files will be picked up by Strava; summary HR stats are included in the activity description
  • Activity names default to "{Type} - {Date}" format
  • The access token expires after 6 hours; generate a new one if the migration takes longer

License

MIT