Today I went out for my first run post-Christmas. It was about as much fun as you’d expect but that’s not the point.
When I finish a run, my watch uploads the data to Garmin Connect, which in turn syncs the data with FetchEveryone (for their great analytics) and Strava (for their API). The Strava API is generally more accessible than Garmin’s and I already use it for integrations with Google Calendar, so it dawned on me that my Strava account has years’ worth of data that I can tap into for various personal projects. Then I had to change course to avoid three horses coming down the centre of the trail.
To get the ball rolling post-run I logged onto my Strava account and accessed my profile, only to find no mention of the API anywhere. Some Googling established that the URL needed updating from https://www.strava.com/settings/profile to https://www.strava.com/settings/api to show the My API Application options, which helpfully includes a link to the Strava Developer documentation:
I completed the fields using the recommendations in the documentation and in response Strava provided a set of API credentials:
The next step was to make a cURL request against the Strava API for my profile data, for which the Strava docs suggested Postman – a platform for building and using APIs. I made an account there, created a GET request for https://www.strava.com/api/v3/athlete and set an Authorization key-value pair using my Strava Access Token:
I then received the below response in JSON:
"id": 18701823,
"username": null,
"resource_state": 2,
"firstname": "Damien",
"lastname": "Jones",
"bio": "",
"city": "[REDACTED]",
"state": "England",
"country": "United Kingdom",
"sex": "M",
"premium": false,
"summit": false,
"created_at": "2016-12-02T00:37:23Z",
"updated_at": "2021-12-27T00:05:26Z",
"badge_type_id": 0,
"weight": 0.0,
"profile_medium": "[REDACTED]",
"profile": "[REDACTED]",
"friend": null,
"follower": null
}
Success!
That’s as far as I’m going to take this today but in the coming days I want to take this forward and try out some of the Python examples in the Strava docs.
Thanks for reading! ~~^~~
2 replies on “Sending GET Requests To The Strava API With Postman: Getting Started”
[…] Picking up from last time, I continued on with the Strava API Getting Started page and got myself very confused over how things were supposed to work. The Strava API requires authentication via OAuth 2.0, and in fairness Strava includes a graph that shows how the process works which unfortunately went right over my head. By chance I found a YouTube video produced by InterSystems Learning Services that gave me a good entry-level understanding of the process, boiling down to this slide: […]
[…] during my initial setup I created an API Application on the Strava site. Strava provided these details upon […]