Search API Connector Documentation
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.
- Before You Begin
- Part 1: Connect to the Strava API
- Part 2: Fetch Data from Strava
- Part 3: Create a Custom API Request
- Part 4: 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
The easiest way to get started with the Strava API is through API Connector’s built-in integration.
- Select Strava from the drop-down list of applications
- Under Authorization, click Connect to Strava
- 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.
Part 2: Fetch Data from Strava
Now that we’re connected, let’s pull some data into Sheets.
- Under Endpoint, choose
/athleteto get data about yourself.
- Select a destination sheet, name your request, and click Run.
Alternatively, you can create a custom request instead of using API Connector’s built-in integration. When you create a custom request, you add your complete URL into the request URL field, and choose Strava from the OAuth menu.
Here are some more examples of custom API URLs. Check the documentation for the full set of available requests, or check out this user-made video from Scott:
- 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:
- Pagination type:
- Page parameter:
- Run until: choose when to stop fetching data
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/.