using RESTFUL API to get currently playing music

Reply

using RESTFUL API to get currently playing music

uncle40
Casual Listener

I use a Linux workstation all day long.

I play Spotify through Sonos.

Sonos doesn't support Linux, so I use an Android device to play Spotify through Sonos.

I'd like to see on my Linux machine what song/artist is playing through Sonos.

Using the Restful API, I try getting "https://api.spotify.com/v1/uncle40/player/currently-playing" but I get nothing back. I'm guessing because nothings is playing on my Linux workstation.

Any idea how I can get the currently playing meta-data on a different device?

 

(iOS 10, Android Oreo, Windows 10,etc.)

 

My Question or Issue

 

5 Replies

Re: using RESTFUL API to get currently playing music

Spotify
Spotify

Hey @uncle40, thanks for writing!

 

Since Spotify doesn't support Linux, it's possible that the app doesn't behave as it would on supported devices. The addition of an API into the mix could also increase the chances of Spotify misbehaving on your end. In this case, we'd recommend using Spotify on any of the devices it's been optimized for, so you get the best experience of ouf our service.

 

We hope this helps. Have an amazing day :)

Re: using RESTFUL API to get currently playing music

uncle40
Casual Listener

Sorry, Julian. REST (and RESTful APIs) are platform independent.

 

Doesn't matter if you're using a Mac, *nix, Windows, or a computer that uses smoke signals... REST is REST, and is language/platform agnostic.

 

If you don't know what you're talking about, maybe you shouldn't talk.

 

Happy August

Re: using RESTFUL API to get currently playing music

SergioDavid
Roadie

Hey @uncle40.

 

Sorry to hear we weren't able to help. Like we mentioned, we don't officially support Spotify on Linux, so some things might not work how you'd like them to. 

 

In this case, it'd be best to see if another Linux user in this board might be able to help out. 

 

Hope you can get this sorted :)

Re: using RESTFUL API to get currently playing music

blubbo
Roadie

Not sure if you got this sorted or not but the adress you should be GETing is: https://api.spotify.com/v1/me/player/currently-playing and you will need to authenticate this request with a oauth token.

 

See here: https://developer.spotify.com/console/get-users-currently-playing-track/

 

And the Setup the Environment section from here: http://blog.getpostman.com/2016/11/09/generate-spotify-playlists-using-a-postman-collection/ might be helpful.

Re: using RESTFUL API to get currently playing music

SergioDavid
Roadie

Hey @uncle40.

 

Be sure to check out @blubbo's suggestions to see if it helps with the trouble you're currently having.

 

Let us know how it goes :)

SUGGESTED POSTS