Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
I'm having issues getting an artist's albums from the API.
Using the form at https://developer.spotify.com/documentation/web-api/reference/get-an-artists-albums
I use the following values:
id = 7n2Ycct7Beij7Dj7meI4X0
limit = 50
The response says total is 71. But there are only 48 items in the response. (I know that valid albums are not included here.)
There is even a "next"-link in the response, with an offset of 50. But that doesn't work as the API only returns 48 albums.
The same issue exists for all other artists I tried with.
Anyone else having this issue?
Solved! Go to Solution.
Do you filter by album-type using include_groups in your request? Can you try to set include_groups=album in your request and check, which value for "total" is returned? After trying out a few things it seems to me, that Spotify limits the number of items in the response to the number of existing items with type "album", but only under some circumstances. I also think this is influenced by the given limit, e.g. for some artists I could reproduce the issue with limit=20 but not with limit=50.
Maybe a workaround could be first loading all items with include_groups=album, then all items with include_groups=single and so on, instead of combining these requests with include_groups=album,single,...
Another thing I noticed, is that if I set the offset to 48, I get 4 items. But when I set the offset to 49, no items are returned.
Something is not right here...
Do you filter by album-type using include_groups in your request? Can you try to set include_groups=album in your request and check, which value for "total" is returned? After trying out a few things it seems to me, that Spotify limits the number of items in the response to the number of existing items with type "album", but only under some circumstances. I also think this is influenced by the given limit, e.g. for some artists I could reproduce the issue with limit=20 but not with limit=50.
Maybe a workaround could be first loading all items with include_groups=album, then all items with include_groups=single and so on, instead of combining these requests with include_groups=album,single,...
This solution seems to work. Odd that they are limited when you combine include_groups, I used limit 50.
I have the same issue, with a different example. There seems to be an issue with the offset when multiple `include_groups` are specified. I could make separate calls for each group, but then it will mean 3 round-trips to the server, which isn't good for anybody.
The example I'm looking at is..
{
"href": "https://api.spotify.com/v1/artists/2cBh5lVMg222FFuRU7EfDE/albums?include_groups=album,single,compila...",
"items": [],
"limit": 50,
"next": null,
"offset": 50,
"previous": "https://api.spotify.com/v1/artists/2cBh5lVMg222FFuRU7EfDE/albums?include_groups=album,single,compila...",
"total": 58
}
So I'm providing an offset of 50, and a limit of 50. The total states that there are 58 records available (which is correct 45 singles and 13 albums), so I'd expect to see 8 albums/singles listed in the `items` element.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…