Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
Hi All,
After following the authorization process 'user-read-recently-played' and checking in my personal account if it worked, I still can't retrieve my recently played tracks. It seems to be an authorization problem, as I can retrieve the user profile info. Below I'll provide you with my authorization code, followed by my code to retrieve the 50 past tracks and my error message. Really hope you can help! Many thanks in advance.
*********** I used the below code to get the authorization:
client_id = "my_id"
redirect_uri = "my_redirect"
scopes = "user-read-recently-played"
show_dialog = "true"
# Build the request URL
url = f"https://accounts.spotify.com/authorize?client_id={client_id}&response_type=code&redirect_uri={redire...}"
# Make the GET request
response = requests.get(url)
# Print the response
print(response.url)
********* And my code to get the 50 last tracks:
gebruikers_id = '{my_id}'
url = f'https://api.spotify.com/v1/users/{gebruikers_id}/player/recently-played'
parameters = {
'limit': 50
}
headers = {
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, headers=headers, params=parameters)
if response.status_code == 200:
print("Verzoek succesvol:")
print(response.json())
else:
print("Fout bij het verzoek:")
print(response.status_code, response.text)
print(response)
*************My errorcode:
404 { "error": { "status": 404, "message": "Service not found" } } <Response [404]>
Solved! Go to Solution.
The URL for the endpoint is: https://api.spotify.com/v1/me/player/recently-played
So, without a user ID.
Also, you can only get the recently played tracks from the authenticated user.
Also, you need the code from this Stack Overflow answer for the authorization code flow.
It isn't just one simple get request.
For some reason my link was shortened in the post. To clarify, my full request authorization link was:
The URL for the endpoint is: https://api.spotify.com/v1/me/player/recently-played
So, without a user ID.
Also, you can only get the recently played tracks from the authenticated user.
Also, you need the code from this Stack Overflow answer for the authorization code flow.
It isn't just one simple get request.
Thanks so much for your quick reply! It works now.
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…