Import Strava Data to Google Sheets
In this guide, we’ll walk through how to pull Strava data data directly into Google Sheets, using the API Connector add-on for Sheets. Strava is, of course, a well-known fitness tracker website and app.
For a real-life example, please also check out this awesome video made by an API Connector user!
- Before You Begin
- Part 1: Connect to the Strava API
- Part 2: Create your Strava API Request URL
- Part 3: Pull Strava API Data into Sheets
- Part 4: More Example API URLs
- Part 5: Handle Pagination
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Strava API
- Open up Google Sheets and click Extensions > API Connector > Manage Connections.
- In the list of available connections, find Strava and click Connect.
- You will be directed to strava.com and asked to sign in, if you haven’t already. You’ll also be asked to authorize the connection.
- You’ll then be returned to your Google Sheet, and can verify that your Strava connection is active in the Connections screen.
Part 2: Create Your Strava API Request URL
For our first request, we’ll get some basic information about your Strava account.
- API root: https://www.strava.com/api
- Endpoint: /v3/athlete
Putting it all together, we get the full API Request URL.
Now let’s grab some data!
- In API Connector, click Create, and paste in the Request URL we created above.
- Under OAuth, choose “Strava” from the dropdown menu. You should see a “Connected” badge.
- We don’t need any headers so just skip that section.
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see some information about yourself populate your sheet.
To get more information about your Strava activities, try the following URLs (one at a time).
- Get your own starred segments
- Get a public list of running races
- Get your own activities
Part 5: Handle Pagination
Note Strava’s limits on the number of records returned on a response. By default, only 30 records will be returned unless you use pagination handling as described in their documentation.
This means that to get 200 records, you’d use the ‘per_page’ parameter, and to return more than 200 you’d then make subsequent requests using the ‘page’ parameter.
With API Connector you can loop through these automatically with pagination handling, like this:
- API URL: enter your request URL, including ?per_page=200
- Pagination type:
- Page parameter:
- Number of pages: enter the number of pages you’d like to fetch
Part 6: API Documentation
To see more API endpoints and example responses, I suggest checking out out the Strava API playground located at https://developers.strava.com/playground/.