Skip to main content

Strava-Backup

Get your data back from Strava.

Strava has an export options, but it will only give you the GPX files that Strava produces after analyzing your uploads.

Thankfully, there is a hidden option to download the original file for individual activities. However, this is only available on the website and not via the API.

This tool uses the API to get a list of all your events, then web scraping to log into the site using your username and password and download the original files for all your activities.

The "original file" will usually be either a *.fit file (most Garmin devices), *.tcx, *.gpx, or *.json (Strava mobile application).

The tool will also output a *.meta.json file for every activity that includes more information on the activity (name, description, type, distance, equipment, etc).

Additionally, the tool will backup your shoes and bikes information, as well as any photos that have been added to activities.

Authentication

Accessing the Strava API requires a short-term access token. In order access your account on an ongoing basis, strava-backup requires a long-term "refresh token" and some other information with which it can generate access tokens. For more information see the Strava API authentication documentation.

A "refresh token" can be generated using a separate program such as strava-tokengen.

In order to back up your data, strava-backup can use the following scopes (all optional):

  • profile:read_all ("View your complete Strava profile"): Will read and backup gear data
  • activity:read ("View data about your activities"): Will read and backup activity data
  • activity:read_all ("View data about your private activities"): Will read and backup private activity data

Accessing the activity data requires web scraping which requires logging into the website. This requires either a username and password, or a JWT token from a previously-authenticated session. Note that JWT tokens expire periodically so providing a username and password is required for running the backup on an ongoing basis.

Setup

Use pip to install this package:

pip install strava-backup

By default, strava-backup will look for a config file called strava-backup.conf in $XDG_CONFIG_HOME/, falling back to ~/.config/ if it's unset. An alternate file can be specified using the --config option.

A sample config file has been included in this package. Copy it to the correct spot and fill in the required information.

Running

strava-backup is an incremental backup. It tracks what has already been downloaded by looking at the output directory and doesn't download it again.

To download all new data, simply run strava-backup. See strava-backup --help for other options. To backup data on an ongoing basis, configure your system to call strava-backup periodically (see the /contrib folder for examples).

Release files for strava-backup 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strava-backup 0.4.0
File Size Uploaded
strava_backup-0.4.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for strava-backup 0.4.0
File Interpreter ABI Platform
strava_backup-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / strava_backup-0.4.0.tar.gz

Download URL strava_backup-0.4.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
68bd0f480af672679bc08d867c938c996cd352c4ed483285f2ec43cfadb3b529
BLAKE2b-256 checksum
How to use checksums
814912738586155c44589419649796ddd3e193e16d2ebe802b2dacc7f7f9475d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / strava_backup-0.4.0-py3-none-any.whl

Download URL strava_backup-0.4.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2310c48d3f66fbdfdd7a09f33eb8979c29887d2191c014453759e09c40630e9a
BLAKE2b-256 checksum
How to use checksums
c5ee65a30d4ea5b117f0ef0feb3f5b88fa722d0b36a2ee3a7cefb220972acf41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page