Spotify Web API special characters

走远了吗. 提交于 2021-02-20 05:13:05

问题


Is there any documentation for the Spotify Web API as to which characters are valid when searching? For example "Macklemore & Ryan Lewis" needs the & to be url encoded in order for the request to work.

The character ":" is completely invalid it seems. In order to search for an album like "Pink Friday: Roman Reloaded", I have to remove the : completely from the String. Even URL encoding it doesn't work. This probably was to do with the fact that : seems to be used to separate the fields of the query.

Other characters like .[()/ seem to work ok. Any docs on this anywhere? Just want to know we are being comprehensive. Thanks.


回答1:


Given the Björk example here,

http://ws.spotify.com/search/1/artist?q=artist:Bj%C3%B6rk

You'll need percent encoding. Not sure what technology you're using, if javascript, this answer should help - URL encode sees “&” (ampersand) as “&” HTML entity.

Update:

Colons are special characters used for advanced search. Queries involving colons need to be quoted, unless it's an advanced search :).



来源:https://stackoverflow.com/questions/20622068/spotify-web-api-special-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!