Announcements

Help Wizard

Step 1

NEXT STEP

Can't get recently played songs -

Solved!

Can't get recently played songs -

 

 

My Question or Issue

Hello, 

I'm trying to get my recently played songs and getting an error message saying. 

{'error': {'status': 500, 'message': 'Server error.'}}

 I'm using the correct scope: 

data = {
    'grant_type' : 'client_credentials',
    'client_id' : CLIENT_ID,
    'client_secret': CLIENT_SECRET,
    'scope': 'user-read-recently-played'.

}
auth_res = requests.post(auth_url, data=data)
access_token = auth_res.json().get('access_token')

headers = {
    'Authorization': 'Bearer {}'.format(access_token)
}
 
endpoint = f"?limit={50}&before={unix_timestamp}"
url = ''.join([base_url,endpoint])
print(url)
response = requests.get(url, headers=headers)
 
 
 

 

Reply

Accepted Solutions
Marked as solution

No  you can not get recently played songs with Client Credentials, because this endpoint requires user authorization.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

View solution in original post

1 Reply
Marked as solution

No  you can not get recently played songs with Client Credentials, because this endpoint requires user authorization.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random