How to get all the tracks of an artist with spotify api?
I am able to view all the tracks on spotify by calling this url:
http://ws.spotify.com/search/1/track.json?q=xxx&page=1
A sample response contains the artist data for each track, like:
[artists] => Array
(
[0] => stdClass Object
(
[href] => spotify:artist:38IfmizrHTCxFjd8UKhWnp
[name] => Husman
)
)
From the above response, i get the artist ID as: 38IfmizrHTCxFjd8UKhWnp .
Now, is there a way to get all the tracks of the above artist ( 38IfmizrHTCxFjd8UKhWnp ), with an api call ?
What i am trying to do is, i would like to display the tracks for each artist in my application.
I see that we can fetch the albums of an artist, with a call like:
http://ws.spotify.com/lookup/1/?uri=spotify:artist:4YrKBkKSVeqDamzBPWVnSJ&extras=albumdetail
But i found that there is no direct way of fetching the tracks of an artist, with the api.
AFAIK, all you can do is a name-based track search, eg http://ws.spotify.com/search/1/track.json?q=artist:Madonna or any other search from the Advanced Search Syntax.
The link to the Advanced Search Syntax seems to be broken at the moment, but you should be able to look at this cached version.
If you're looking to make more powerful queries, I'd really suggest you have a look at The Echonest's API. It's quite awesome, and has supports for working with Spotify URI:s. Also, it's being continuously developed, whereas the web API Spotify's provided hasn't really evolved in the past years (but maybe it will, who knows).
由于官方的高级语法现在已经被破坏,你可以在网页存档中找到它:http://web.archive.org/web/20120704131650/http://www.spotify.com/us/about/features/高级搜索语法/
In the Spotify Developer Home i found this ( https://developer.spotify.com/technologies/web-api/ )
http://ws.spotify.com/search/1/artist?q=38IfmizrHTCxFjd8UKhWnp
Maybe help.
链接地址: http://www.djcxy.com/p/55648.html上一篇: 我需要多少钱来清理搜索查询?