1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Python

Connected

Exercise

API requests

Now it's your turn to pull some movie data down from the Open Movie Database (OMDB) using their API. The movie you'll query the API about is The Social Network. Recall that, in the video, to query the API about the movie Hackers, Hugo's query string had a single argument t=hackers.

Instructions

100 XP
  • Import the requests package.
  • Assign to the variable url the URL of interest in order to query 'http://www.omdbapi.com' for the data corresponding to the movie The Social Netork. The query string should have one argument t=social+network.
  • Print the text of the reponse object r by using its text attribute and passing the result to the print() function.