<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Consuming API
Instead of using web scraping, using an API, application programming interface, is the preferred method.
Usually, you need to register in order to use an API. But we will use a freely available API called Open Movie Database API.
1. Install Python library
There already exists a Python library for the Open Movie Database API, called omdb.
Install it with pip.
Step1:  2. Access the API
Step2:  3. Present results
Step3:  4. Get more info
Step4:  Exercise
Pick your favorite movie or tv-series, and search for it.
We used movie["title"] to show the title of the movie. Show something else! The documentation says you can get this info
<ASSISTANT_TASK:>
Python Code:
!pip install omdb
Explanation: Consuming API
Instead of using web scraping, using an API, application programming interface, is the preferred method.
Usually, you need to register in order to use an API. But we will use a freely available API called Open Movie Database API.
1. Install Python library
There already exists a Python library for the Open Movie Database API, called omdb.
Install it with pip.
End of explanation
# Import the library.
import omdb
# Search for movies.
movies = omdb.search("Westworld")
movies
Explanation: 2. Access the API
End of explanation
# Since "movies" is a list, we can loop through it.
for movie in movies:
    print("Title: " + movie["title"])
    print("Type: " + movie["type"])
    print("Year: " + movie["year"])
    print("Link: http://imdb.com/title/" + movie["imdb_id"])
    print()
# Lets pick the first movie (remember, lists always start at 0).
movie = movies[0]
print(movie["title"])
print(movie["year"])
Explanation: 3. Present results
End of explanation
# Instead of searching (and get a list of movies), we can specify the movie we want (and get a single movie).
movie = omdb.title("Westworld", year="2016")
movie
# Present some info about this movie.
print(movie["title"])
print(movie["year"])
print(movie["country"])
print("Rating: " + movie["imdb_rating"])
print(movie["plot"])
Explanation: 4. Get more info
End of explanation
# Modify this.
movie = omdb.title("Westworld", year="2016")
print(movie["title"])
Explanation: Exercise
Pick your favorite movie or tv-series, and search for it.
We used movie["title"] to show the title of the movie. Show something else! The documentation says you can get this info:
title
year
type
actors
awards
country
director
genre
episode
season
series_id
language
metascore
plot
poster
rated
released
runtime
writer
imdb_id
imdb_rating
imdb_votes
box_office
dvd
production
website
tomato_consensus
tomato_fresh
tomato_image
tomato_meter
tomato_rating
tomato_reviews
tomato_rotten
tomato_user_meter
tomato_user_rating
tomato_user_reviews
End of explanation
<END_TASK>