2
votes

Does spotify's web api allow album and artist queries with a list of {id}s?
From the docs, the endpoints take in only one entity id per request https://developer.spotify.com/web-api/console/

1

1 Answers

3
votes

Yes, the Spotify Web Api supports both of these; you simply have to omit the {id} from the end of the URL. So to query a single able ID you would want /albums/{id}, but to query multiple albums you would want just /albums. This is common practice in RESTful services.

Spotify has an endpoint /albums which takes in the ids parameter in a comma-separated format:

curl -X GET "https://api.spotify.com/v1/albums?ids=382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc&market=ES" -H "Accept: application/json"

Along with an endpoint /artists which takes in the ids parameter in a comma-separated format:

curl -X GET "https://api.spotify.com/v1/artists?ids=2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6" -H "Accept: application/json"