We use Python 3.6

go back Level: Intermediate (img: IM / score: 3) level Bite 27. Parse omdb movie json data

31 out of 31 users completed this Bite ...
Will you be Pythonista #32 to crack this Bite?
Average Bite difficulty 1-10 rating: 3.5
» You can do it! 😌

Working with APIs is very common these days and lucky for us they increasingly return JSON (over XML). We saved OMDb responses for some cool movies that the template code loads in.

Parse this data answering some questions:

  1. get_movie_data should return a list of movie dicts, so for each movie you convert the json file to a dict.
  2. now you have the data structure, loop through the movies and return the movie:
    • with Comedy in Genres (get_single_comedy)
    • that had the most nominations (get_movie_most_nominations)
    • having the longest runtime (get_movie_longest_runtime)

Expect to do some string parsing and type conversions here. We hope you like it, enjoy!

Github login button