In Excercise 2, we see this hint:
# Update the offset value with the current value from the request you did plus the limit value.
offset = response.None('None').None('None') + None
This is very misleading. If you try to use the offset value from the response, it creates an infinite loop.
So either one of the following is true:
We’re not supposed to literally replace None values here, and instead need to use a completely different approach.
The mock API does not return an updated offset value.
Either way, this assignment needs to be updated.
@yy55pl I tried this lab when the Spotify API was still available and I used this code:
offset = response.get(‘albums’).get(‘offset’) + limit
Can you confirm that you are trying the same? if you are trying the same code but you are getting a problem, then you might be right and the problem could be the mick API.
Please try it and let me know
This thread might be useful re: the mock API.
Hi all! A couple of months back we deployed a patch with a mock API so that you can still run the lab. Please make sure to run the first code cell of the notebook to import the necessary functions.
We are working on creating a new lab that no longer relies Spotify, but in the meantime please use the patch so that you are not blocked by this lab, and you can still get the experience of working API requests.
Cheers,
Magdalena
I was able to figure it out. The problem was I had a bug in the first exercise that was hard to notice.
I still think this lab should be updated. The first function we have to fill out should have some better verification that we’ve implemented it correctly.
@yy55pl Excellent!
I am glad this is working now. I am closing this thread then.
Thanks for your input!
TMosh
May 1, 2026, 4:43pm
7
Can you suggest a test that might have caught the error in your code?
(I re-opened the topic)
It would have been beneficial to have a test that shows the request_url value changes when the offset and limit values change.
So maybe have
releases_response = get_new_releases(url=URL_NEW_RELEASES, access_token=token.get('access_token'))
print(releases_response)
releases_response = get_new_releases(url=URL_NEW_RELEASES, access_token=token.get('access_token'), 10, 10)
print(releases_response)
Something along these lines.
TMosh
May 2, 2026, 11:17pm
10
Thanks, I’ll submit a support ticket to update that test.