Hi,
When requesting search results with an 'offset' parameter of more than 99 the response json contains an empy item array, even when the total number of results is more than 100. For example, I get the following response with an 'offset' parameter of 100. However, the total number of expected results is 848 so in this case I would expect an full array of 50 items due to the 'limit' parameter being set to 50.
curl --request GET \
--url 'https://api.spotify.com/v1/search?q=label%3AKompakt&type=album&limit=50&offset=100'
{
"albums":{
"href":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=100&limit=50",
"limit":50,
"next":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=150&limit=50",
"offset":100,
"previous":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=50&limit=50",
"total":848,
"items":[
]
}
}
With 'offset' of 99, only 1 item is returned...
{
"albums":{
"href":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=99&limit=50",
"limit":50,
"next":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=149&limit=50",
"offset":99,
"previous":"https://api.spotify.com/v1/search?query=label%3AKompakt&type=album&locale=en-GB%2Cen%3Bq%3D0.5&offset=49&limit=50",
"total":848,
"items":[
{
"album_type":"single",
"total_tracks":2,
"available_markets":[
],
"external_urls":{
"spotify":"https://open.spotify.com/album/00aoFgHb7qw8PMkYxQZw9W"
},
"href":"https://api.spotify.com/v1/albums/00aoFgHb7qw8PMkYxQZw9W",
"id":"00aoFgHb7qw8PMkYxQZw9W",
"images":[
{
"url":"https://i.scdn.co/image/ab67616d0000b27349f793dd743b337a1e8fa7ac",
"height":640,
"width":640
},
{
"url":"https://i.scdn.co/image/ab67616d00001e0249f793dd743b337a1e8fa7ac",
"height":300,
"width":300
},
{
"url":"https://i.scdn.co/image/ab67616d0000485149f793dd743b337a1e8fa7ac",
"height":64,
"width":64
}
],
"name":"Walls vs. Gerd Janson & Prins Thomas",
"release_date":"2012-09-03",
"release_date_precision":"day",
"type":"album",
"uri":"spotify:album:00aoFgHb7qw8PMkYxQZw9W",
"artists":[
{
"external_urls":{
"spotify":"https://open.spotify.com/artist/4zLjvhhQ5WLRFCKPPgx8q6"
},
"href":"https://api.spotify.com/v1/artists/4zLjvhhQ5WLRFCKPPgx8q6",
"id":"4zLjvhhQ5WLRFCKPPgx8q6",
"name":"Walls",
"type":"artist",
"uri":"spotify:artist:4zLjvhhQ5WLRFCKPPgx8q6"
}
]
}
]
}
}
Please note I am not attempting to retrive more than 100 results with one request. I am limiting the result items to 50 and adjusting the 'offset' parameter to retrive the full result set of 848 over multiple queries. Using the url specified in the 'next' property in the json response also yeilds no results.
As far as I can tell the behaviour has changed over the last week or two. It was previously possible to get the the full result set of 848 items using the 'next' url.
Please could you confirm if this is expected behaviour or a newly introduced issue?
Thanks in advance for your help.