C2-w1-lab1-s1 batch processing

I am having problems with Spotify’s API. I noticed that the requests don’t behave as expected.
For example when I send a get request to https://api.spotify.com/v1/browse/featured-playlists?offset=45&limit=20
The answer’s next is
https://api.spotify.com/v1/browse/featured-playlists?offset=20&limit=20

However when I pass offset and limit as parameters to the get request I receive the answer I expect.

This makes it impossible to proceed with the lab.

Hello @silviudr, the error 401 according to playlist get_playlist response documentation happens when: “Bad or expired token. This can happen if the user revoked a token or the access token has expired. You should re-authenticate the user.”
In the lab walkthrough it is mentioned that: “the access token is valid for an hour. After that time, the token expires, and you need to request a new one.”

Sorry @silviudr I misread your question. I guess you are after Exercise 2 paginated_featured_playlists. Are you getting an output like this, with the same offset?:

It seems I reproduced the error in get_featured_playlists function. Could you try request_url instead of url when you perform a get request in the function. Thank you

This works. Thank you.

1 Like