NickDK
NickDK

Reputation: 1009

Spotify Web API special characters

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.

Upvotes: 1

Views: 1981

Answers (1)

Thomas
Thomas

Reputation: 3358

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 :).

Upvotes: 2

Related Questions