Skip to main content

I'm extremely new to this but after trying to get anything to work for 3 hours I thought I'd ask here.

I'm trying to get activity data for a Python project. I've followed all the steps on the getting started doc and now I'm trying to use the requests module in Python to get activity information.

Why isn't this working?

import requests

access_token = ""

headers = {"Authorization" : f"Bearer {access_token}"}

response = requests.get("https://www.strava.com/api/v3/athlete/activities", headers=headers)
print(response)
print(response.text)

I just keep getting:
<Response [401]>
{"message":"Authorization Error","errors":[{"resource":"Athlete","field":"access_token","code":"invalid"}]}



Really grateful for any help on this I'm completely lost 😕😕

check access token use new access token if its expires ... access token expires every 6hr


I am also facing the same problem
 

 


Encountering the same problem also. I can't authorize(?) my token when using local host


Reply