Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

/me/player/recently-played returns only items with context null

/me/player/recently-played returns only items with context null

Hi everyone!

 

I'm trying to write a small app against the Spotify Web API with which I want to capture the currently active song. If the song is currently playing, I can easily use the /me/player/currently-playing endpoint to get the track and context. If the song is paused, however, this endpoint does only return HTTP 204, same with the /me/player endpoint (even though both in principle have an is_playing flag). This is why I'm trying to fall back to /me/player/recently-played in this case.

 

However, for all the items in /me/player/recently-played, the context is null, which is unexpected, judging from the documentation: https://developer.spotify.com/documentation/web-api/reference/player/get-recently-played/

 

This seems to have already been an issue posted by someone else on the old issue tracker (https://github.com/spotify/web-api/issues/966), so I'd thought I'd follow up here.

 

Just as a clarification: I started playback by clicking "Shuffle" on one of my public playlists. When playing, I can access the context through /me/player/currently-playing. I'm not in offline mode or a private session.

 

Thank you for your help!

 

P.S.: If there is a better way to get the currently playing song even if it has been paused for the last few minutes, please let me know as well. I've read the /me/player API documentation, but feel like I've missed some way to do better 🙂

Reply
1 Reply

It got solved for my account!

Yesterday, I contacted Spotify Support with my problem, and it appeared that my account was corrupted. After the support employee fixed that, I deleted the Spotify data from my phone and desktop. Then I logged back in and tested it again. I still got "context": null, but today I tested it again, and now it is does show context!

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

Type a product name