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

/v1/me/player/devices returns empty array

/v1/me/player/devices returns empty array

My Question or Issue
The /v1/me/player/devices endpoint returns empty list even when a spotify device is open.

 

Steps to reproduce:
1. Open Spotify on your Windows desktop machine (do not play anything)
2. Hit the /v1/me/player/devices endpoint. Notes: I am using a valid access token that was issued on behalf of a user, it also has the `user-read-playback-state` scope.

 

Expected Behavior:
The endpoint should return a list with 1 spotify device, the one I opened on step 1

 

Actual Behavior:
The endpoint returns an empty list.

 

Final Notes:
If I go and play some music on the spotify device opened on step 1 and hit the endpoint again, this time I do get the list with 1 spotify device.

 

In my opinion this is a bug because I can agree that the spotify device that is currently playing music should be marked as the active device, but I do not understand why the endpoint returns an empty array if I have a spotify device open but not playing music.

 

Any help would be much appreciated.
Thanks

Reply
17 Replies

Same problem here. And yes, I have already checked the possible reasons listed here.

 

I (kind of) understand if /v1/me/player/devices doesn't return a specific smartphone/tablet device while the app is not running - the device is technically "sleeping" in that case. But this also happens with my smart TV, Chromecasts and my custom Librespot server-side receiver.

 

These devices are technically always available, I can indeed always see them if I select the list of devices from the Android app, but I can't see them from the API endpoint, if not shortly after they've come online.

 

This definitely sounds like a bug: in theory the same list of devices should appear on the Spotify Android app and on the API endpoint, but this is currently not the case.

 

--EDIT--

 

Another way to bring the device "online" is to go through the app, select players and select the device. But is this supposed to be the expected behaviour for this endpoint - return only the devices that are either running the app or are currently paired through the app? How can the app discover them then - is there another endpoint for it? If Chromecasts and external players are indeed reported as "sleeping" when they are not actively paired to an app, and the endpoint doesn't return sleeping devices, then how can we retrieve them?

Hi guys, I'm suffering the same issue. This feature is crucial for the apps integrated with the Spotify API, I would like more attention from the maintainers. 
I also can confirm the issue was working a few months ago, my app was working fine with all devices ( Alexa's devices, phones, etc ). Cause we don't have API versions, I'm guessing that some bug was added. 

Thanks in advance, we really need this fix.

Yes please look at this! I am having the same issue with get devices and to transfer playback. Even on the same Wifi I get no devices, unless the app is up or the speaker is playing. I also can only transfer playback unless the app is up.

I think they don't care, it is really sad. 

Spotify people just don't give a s about these tickets, meaning they don't give a s about the people using their apis which is really unexpected and sad

It's unreasonable to just ignore a significant issue like this. I've been using Spotify for many years. Now I want to use the API to choose a device for playback. The API can't do it and I see Spotify doesn't respond to this issue for a very long time. Now I have to look for a different music provider, maybe Google Music.

Having the same problem but when I request to get device ids I am getting an error with the status of 401 even though my laptop's Spotify is active (playing). I am using a valid token to request, but somehow I am getting an error with the message No token provided or Permission is missing. I've searched a lot about this topic and used all the techniques, and seen some people getting device ids when the device is playing or smth like that.  Maybe I did something wrong, cause I am not a pro with API's. If is there any solutions I would appreciate the help.

screenshot_api_problem.jpg

Hey Spotify team. 
As @pablohgm said above: "This feature is crucial for the apps integrated with the Spotify API" 

I am developing a new app integrated to Spotify API. 
When I don't have Spotify opened (or in my cell, or in my laptop), I receive devices empty array... But when I open one of them, then it shows up in the devices array.
Please, provide us some solution for this. Some endpoint to "wake up" devices... or something.
Right now, I have to show a notification saying "Please user, open your Spotify app and come back to this app" **bleep**, I suppose 50% of users will just go away... 

Hi there,

Another dev here shouting for help with this issue. As said above, requesting the user to "wake" the devices by going to the Spotify app themselves is a far from idea journey for an integrated App. Waiting for this until I can deliver any meaningful functionality in my app.

Thank you.

There seems to be something wrong around devices in general. 
The GET /me/player is supposed to return a device. According to the API docs the device is a mandatory field. But it's not returning at all (not even null). Not when I play a track actively on the phone, computer or speaker. 

 

Also the here mentioned /me/player/devices endpoint does not work reliably. For me it returns one computer, but not the 2 other speakers. Sometimes it also returns a computer that wasn't turned on in the last 14 days and then it's gone again the next second. So it doesn't really matter if a device is sleeping or not. 
Why does it not return the exact same list that is visible in the Spotify first-party apps?

Similar issue. I run raspotify on a RPI and when requesting via WEB API the list of devices I get an empty array. The RPI only appears on the list when I use my phone and select it via Spotify app (I can see it there).

Has this bug still not been fixed?

Yeap still an issue. IMO the APIs are starting to regress worst and worst every year. sad cause Spotify APIs was full of gold and amazing at one point, but seems like they are not much so any more.

I don't even understand this endpoint.

Sending "Play" from my app will sometimes return "No active devices".  Then also the devices endpoint will return an empty array.

So i'm just dead in the water?  I don't get how a device can get added to the list or why it doesn't just maintain a list of devices the user has.  There is an "active" property so why are you not giving me the inactive ones as well?

Is this whole development environment just a bad joke??

I wouldn't even need the WebAPI if the Remote SDK could play a song from a set position. But here I am trying to Frankenstein a hybrid remote/webapi solution together just heaping in complexity as I go trying to dodge possible show stoppers like this.

If Spotify doesn't want to pay someone to look at this stuff then they should offer a bounty and let us crowdfund it.

What is even going on over there?

I have one more thing to add.

My app is ON the device I want to play the songs on. The Remote SDK should just return the device ID and then I can use that to send up to the WebAPI.  Ironically enough the remote SDK has a connectApi.connectSwitchToLocalDevice method, which you would think would set that as the device that is playing songs but sending a request to the WebApi will still return back "No Active Device".  So it doesn't actually do that?

Not having that device discoverability puts me in this death spiral of having to discover the device name of the device MY APP IS ON and then sending that along with the Play request.  That's all fine if this endpoint would return the user's devices always instead of an empty list.




I have the same problem. I dont understand how this is supposed to Work.

 

After I open the app on my iPhone, the devices list is populated.

 

I guess the app uses broadcasts on the wifi to Find/detect available players on my network.

 

but after some hours, the devices list is cleared out, and I cannot start to PLAY via the api.

 

the only way to use the api again is to first open the iPhone app to repopulate the devices list.

 

This is totally useless. The reason for me to use the api is to be able to control playback on my devices -without- the Spotify app.

 

How is this even supposed to Work?

 

 

My initial post was almost 4 years ago, I think it is clear that the Spotify Api devs just dont give a s about these kind of things. I guess is not on their benefit for people to start using their API to create cool stuff. 

This post just proves to me the lack of responsibility and professionalism of the team behind this API. I would just advice people to put your energies in other places that dont require doing anything with Spotify APIs 

Suggested posts

Type a product name