Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Searching an artists's tracks by artist id #493

Open
Waiski opened this issue Apr 21, 2017 · 3 comments
Open

Searching an artists's tracks by artist id #493

Waiski opened this issue Apr 21, 2017 · 3 comments

Comments

@Waiski
Copy link

Waiski commented Apr 21, 2017

It seems that in the search API, one can search within tracks of a specific artist name by adding artist:"The Band" in the query, but this has the drawback of additionally matching artists whose name includes the searched artist, like "The Band Perry". In my app, I'd like to create a search system where users can first search for an artist, and then search within the tracks of this specific artist, and this could give them a bad user experience, since the resulting tracks may include stuff from unrelated artists as well.

To address this, it would be nice to be able use the artist's id in the search like artist:4vpDg7Y7fU982Ds30zawDA (or then a separate API altogether, or adding an optional query parameter to the artists/{id}/top-tracks endpoint). I can't see that this would be very hard to implement or break any existing systems. And at least someone on Stackoverflow has been looking for this functionality. So could it be implemented? Or am I just missing some existing way of accomplishing this?

@jscholes
Copy link

This is honestly something I was surprised to see missing from the web API also. However if you already have the ID of the artist your users are interested in when you perform the track search, you can just filter the data you get back so that it only includes tracks with the matching artist ID. Not the most efficient way of doing things but it will work well enough that your users won't notice that you're employing a bit of a hack, which is the most important thing.

@Waiski
Copy link
Author

Waiski commented Apr 21, 2017

I'm surprised too, this seems like a rather basic functionality. I'm going to do the filtering programmatically as you suggested, but this has the drawback of potentially having to fetch more results if there are not enough in the first batch.

@jesperholstjh
Copy link

Any news on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants