Can i play track in play.spotify.com?

My problem is, I want to search for a single songs ( or many single songs in a array) and Echonest will return me a Spotify ID in a foreign_ID. Then I can use this Spotify_ID to continue searching for a desired song in Spotify library.

In this example this returns Tracks : http://developer.echonest.com/api/v4/song/search?api_key=QR3H8MYBUZDYTDWUB&format=json&results=1&artist=the%20Carpenters&title=top%20of%20the%20world&bucket=id:spotify&bucket=tracks

{"foreign_release_id": "spotify:album:0RZyZDffrtXVREHqoREIuA"
, "catalog": "spotify",
 "foreign_id": "spotify:track:4VdTKWly7revQ8VoncG43z",
 "id": "TRUBERV144D15243BC"},
 {"foreign_release_id": "spotify:album:3jMQ6qZZASytoRwVBSRou9",
 "catalog": "spotify",
 "foreign_id": "spotify:track:3NG65ZHLpDHQrEPMbqIhbS",
 "id": "TRRIMLE144D120B851"},
 {"foreign_release_id": "spotify:album:5PzGOu1yBtxDc7n8Dc0Oed",
 "catalog": "spotify",
 "foreign_id": "spotify:track:48Xjc1yYvAYikRHQxdyERF",
 "id": "TRBFCHA147B6E38122"},
 {"foreign_release_id": "spotify:album:0AictFxEiiyOtuZ9S2PnnD",
 "catalog": "spotify",
 "foreign_id": "spotify:track:4lEJYHkieQi5LfyFrN5bel",
 "id": "TRTEGDO147B6E4E95A"}

When I attach the spotify id which i get from echonest's return to the play.spotify.com that becomes "play.spotify.com/track/4lEJYHkieQi5LfyFrN5bel" it doesn't work, i don't know why. When I attached to album or artist, it works "play.spotify.com/album/3jMQ6qZZASytoRwVBSRou9".

I want to ask one more question: can I stream one track (one song) directly from spotify into my web application after I use the command: GET "api.spotify.com/v1/tracks/{id}" to get url of the track(the song)?


The track plays for me when I go to: https://play.spotify.com/track/4lEJYHkieQi5LfyFrN5bel

The specific track is not available in any market any longer, which you can see if you check https://api.spotify.com/v1/tracks/4lEJYHkieQi5LfyFrN5bel

$ curl -s https://api.spotify.com/v1/tracks/4lEJYHkieQi5LfyFrN5bel | jq .available_markets
[]

However, there are many other tracks that has the same recording and Spotify should play one of those tracks instead. To see the one that client should play instead add market as a query parameter, in my case SE for Sweden. https://api.spotify.com/v1/tracks/4lEJYHkieQi5LfyFrN5bel?market=SE and check the uri attribute.

$ curl -s https://api.spotify.com/v1/tracks/4lEJYHkieQi5LfyFrN5bel?market=SE | jq -r .uri
spotify:track:4Hbj7GnBASAS6dUmsIMD6q

I can't imagine that you are in a market where there is no replacement for this track. I think it is a bug with the Spotify web player.

链接地址: http://www.djcxy.com/p/55668.html

上一篇: Spotify Web API客户端作用域不起作用

下一篇: 我可以在play.spotify.com中播放曲目吗?