C2W2 Assignment. Spotify API is showing 403({'error': {'status': 403, 'message': 'Forbidden'}})

I am currently working through the lab regarding the Spotify API batch task and have encountered a persistent 403 Forbidden error.

The issue occurred during the new-releases step. While the first call was successful, the error triggered specifically when I attempted to fetch the second batch using the following command:

next_releases_response = get_new_releases(url=URL_NEW_RELEASES, access_token=token.get('access_token'), offset=20, limit=20)

Since the error appeared, I am unable to interact with the API further. I have already attempted the following troubleshooting steps:

  • Token Refresh: I generated a new access token to ensure it hadn’t expired.

  • Code Review: I’ve verified the get_new_releases function logic and confirmed that the parameters (offset and limit) align with the API documentation.

  • Scope Check: I confirmed that the initial authorization included the necessary scopes.

Is there a specific restriction within the lab environment or the Spotify Developer Dashboard that might be triggering this 403 after the first batch? Any guidance on how to bypass this block would be greatly appreciated.

Hi @arielgal, I hope you are fine.
I have just completed the lab without any issues.
From you description, I can guess that you are using the actual Spotify API, my recommendation now would be:

  1. Restart the lab, and if the issue persists,
  2. Try to use the mock API in order to complete the lab.
1 Like

Thank you @Richaldo, I’ve used the mock API…

1 Like