Blue Week Special Offer | Brighten your week!

Working with APIs _ Adding Query Parameters

Screen Link:

Working With APIs In Python | Dataquest

I can’t understand one of the asks of the mission :" 1. Assign the content to the variable content." How do we do this ? The DQ solution given below seem adequate enough.

parameters = {“lat”: 37.78, “lon”: -122.41}

Make a get request with the parameters.

response = requests.get(“”, params=parameters)

Print the content of the response (the data the server returned)


What exactly is confusing you here at the moment? We are being asked to assign something to a variable.

Query is that we are being asked to assign something to a variable called content.
I don’t see it happening in the answer, except for the word ‘content’ appearing in print(response.content). Here it seems as if response.content is an argument. I am completely new to APIs , so this doesn’t make sense to me

It’s right there at the bottom

They seem to have the default editor code first and then the actual answer code after that. But it’s there for the code corresponding to the instructions.

thanks. I was confused between the variable called “content” and the method called “content” within “response.content”.