Getting started with the Strava API can be a hassle if all you wanted was to pull your data and play with it. Strava2SQL offers a quick and easy way to pull all your activities into a local SQLite database that you can then work with.
Strava2SQL uses only requests and sqlalchemy to download data, but a quick demo uses Pandas for easy data manipulation.
-
Register an API application with Strava, using 'localhost' for the callback domain (if you don't have or intend to use one).
-
Run initial_auth.py, entering your Strava client ID and client secret from https://www.strava.com/settings/api There are several editable sections in the code. This is only necessary if you would like to retrieve different scopes for access tokens, OR you have more than ~50,000 activities. Search the file for "edit" and read the comments.
-
Run activities_load.py, which will create a SQLite database in the same directory containing all your activities. Using DB Browser for SQLite (https://sqlitebrowser.org/) is a good way to get a first glance at your data.
-
Run tests/activities_by_dow.py to get a printout of your average ride distance (m) by day of week.