Strava
Get Your Own Strava Data¶
- Sign in to Strava ;
- Go to Strava Developers -> Create & Manage Your App
-
Create
My API Application
: Enter the informationWarning
The items in the red box are required. And the Authorization Callback Domain must be
localhost
.Created successfully:
-
Use the link below to request all permissions: Replace
${your_id}
in the link withMy API Application
Client IDhttps://www.strava.com/oauth/authorize?client_id=${your_id}&response_type=code&redirect_uri=http://localhost/exchange_token&approval_prompt=force&scope=read_all,profile:read_all,activity:read_all,profile:write,activity:write
-
Get the
code
value in the link example:http://localhost/exchange_token?state=&code=1dab37edd9970971fb502c9efdd087f4f3471e6e&scope=read,activity:write,activity:read_all,profile:write,profile:read_all,read_all
code
value:1dab37edd9970971fb502c9efdd087f4f3471e6
-
Use
Client_id
、Client_secret
、Code
getrefresch_token
: Execute inTerminal/iTerm
example:curl -X POST https://www.strava.com/oauth/token \ -F client_id=${Your Client ID} \ -F client_secret=${Your Client Secret} \ -F code=${Your Code} \ -F grant_type=authorization_code
curl -X POST https://www.strava.com/oauth/token \ -F client_id=12345 \ -F client_secret=b21******d0bfb377998ed1ac3b0 \ -F code=d09******b58abface48003 \ -F grant_type=authorization_code
-
Sync
Strava
datapython3(python) scripts/strava_sync.py ${client_id} ${client_secret} ${refresch_token}
References¶
https://developers.strava.com/docs/getting-started
https://github.com/barrald/strava-uploader
https://github.com/strava/go.strava