Week 2 Assignment: Batch Processing to Get Data from an API

Hi, I could note open the jupyter notebook as the service is not responding even after the successful setup.

I tried opening it incognito mode, cleared cache, also, I tried modified inbound rules of the SG, but still wasn’t found any luck.

Coursera is having technical problems. Hopefully they will fix it soon.

do we have any luck on this

Yes, the issue that was affecting other courses has been resolved.

If you’re still seeing a problem, it must be a different issue.

I had this issue just earlier today. To be honest, I never post. But this was a problem and didn’t want to use up time only to figure it wasn’t something I could control.

@rfernando did it work for you after all or are you still experiencing this?

I am getting an infinite loop with the next page functionality because it looks like kwargs is being expanded correctly or something.
added:
print(kwargs)
print(f"Executed request with URL:
response.get(‘playlists’).get(‘href’)}.")
OUTPUT:
{‘url’: ‘https://api.spotify.com/v1/browse/featured-playlists’, ‘access_token’: ‘BQAjLYTjZknj4sEMnTq6Fnmat58Rb4gYHI2hZsnhOiD_8BHgT9AQKoeDU1AVoQhNOn2taT7Eji7d0zpBAp-TLHWKyS_FMVKWIf4ZEqcVXu4ZR86XUjw’, ‘next’: ‘https://api.spotify.com/v1/browse/featured-playlists?offset=20&limit=20’}
Executed request with URL: https://api.spotify.com/v1/browse/featured-playlists?offset=0&limit=20.
{‘url’: ‘https://api.spotify.com/v1/browse/featured-playlists’, ‘access_token’: ‘BQAjLYTjZknj4sEMnTq6Fnmat58Rb4gYHI2hZsnhOiD_8BHgT9AQKoeDU1AVoQhNOn2taT7Eji7d0zpBAp-TLHWKyS_FMVKWIf4ZEqcVXu4ZR86XUjw’, ‘next’: ‘https://api.spotify.com/v1/browse/featured-playlists?offset=20&limit=20’}
Executed request with URL: https://api.spotify.com/v1/browse/featured-playlists?offset=0&limit=20.

any help would be appreciated this is my second attempt because of the 2 hour limit.

Hello @bclark
The test cell for exercise 3 uses the get_featured_playlists method, which we fill in in exercise 1. Therefore, please check your code for exercise 1 as well and make sure that it is working properly.

Hi There,

I have the same issue, it keeps producing the same href in an inf loop.
In exercise 1 and 2 it seems to be working just fine.


I have no idea why it doesn't work.

Hello @Kiril_Milev, Could you check in exercise 1 get_featured_playlists,
that you are correctly using: Perform a GET request using the request_url and headers.
If you use url instead the offset will not increase and 0 update in the following cells. Thanks

Also sharing your code is against the code of conduct. As a reminder try not share it here please

I have deleted the shared code, sorry about that.
And thank you, I have fixed my code!

1 Like

I have check several times the code. When I print out the value in kwargs[‘next’] is ok but it seems the nmew value of the argument is not taken into account when running again endpoint_request() function

[quote=“Gustavo_Bula, post:12, topic:715346, full:true”]
I have check several times the code. When I print out the value in kwargs[‘next’] is ok but it seems the nmew value of the argument is not taken into account when running again endpoint_request() function

Hello @Gustavo_Bula
If the kwargs["next"] is set properly, it means that the next variable is sent to the get_featured_playlists function. Then, the request_url variable in the method is set to the next input.


If you use request_url in your requests.get method, there should be no problem.

Hello @elbryan,
I think your error is because you are using the local variable response instead of releases_response which is out of scope in the get_new_releases function.
Another thing is you need to use the request_url and headers instead you are hard coding the url (just use request_url) which will not update the index later in the code.
You might need to start over, keep the indentation and change only specific parts of the code (START to END CODE HERE)
There are some mistakes that if you keep the original structure, like headers call auth_header and follow the instructions make things easier. Thank you

I am trying to try the code on my local machine. The get_token could not work and return with the {‘error’: ‘invalid_client’}.

Any clue of the problem?

Resolved- Thanks @Georgios

1 Like

Hello @fongsow_59,
It seems I couldn’t reproduce the error locally, after adding those lines before get_token it works, thanks:
CLIENT_ID=‘copy Client ID alphanumeric’
CLIENT_SECRET=‘copy Client secret alphanumeric’
AAP_NAME=‘spotify-app’

I am facing grader issue for this assignment.
Can anyone guide me?

Hello @mayankj7,
You can actually get 80/100 after you submit exercise 3 correct output. Not sure how the grader works but you could check in other post people having the same issue. Thanks