searchAlbums response doesn't match that of Spotify Console when using encodeUriComponent
ben-obringer opened this issue · 0 comments
For context, I've been searching for albums using the following format album:"Album title" artist: "Artist name"
, and this usually works. Issues arise when special characters are involved. Here is an example:
- album:"At.Long.Last.A$AP" artist:"ASAP Rocky"
It's also worth mentioning that this query does not return anything in the Spotify console as well.
So after doing some research, I came across this article which states that the query must be encoded https://pappmaskin.no/2017/02/linking-to-a-spotify-search-with-both-track-and-artist/. Doing this changes the above example to:
- album%3A%22At.Long.Last.A%24AP%22%20artist%3A%22ASAP%20Rocky%22
I tried using the Node API with this new format, but now every query I try (including the ones without special characters that initially worked) are no longer returning results.
Trying this encoded example in the console produces results https://developer.spotify.com/console/get-search-item/?q=album%253A%2522Whokill%2522%2520artist%253A%2522Tune-Yards%2522&type=album&market=&limit=&offset=&include_external=.
So to sum things up, it would be helpful to give this API encoded uris as that is what the Spotify API requires when using special characters.
I dug around in the code for about 30 min, but couldn't find anything that's preventing the Node API from behaving properly. Does anyone have any ideas as to what's going on here?
Thanks, Ben