Open In App

Python IMDbPY – Retrieving movie using movie ID

Last Updated : 22 Apr, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article we will see how we can retrieve the data of movie using its movie ID, movie id is the unique id given to each movie by IMDb. We can use search_movie method to search the movies by their name but it gives many movies as they have same names therefore retrieving a movie by its id is a better option.

In order to search a movie by its id we use get_movie method.

Syntax : imdb_object.get_movie(id)

Argument : It takes string as argument which is movie id

Return : It returns imdb Movie object.

Below is the implementation.




# importing the module
import imdb
   
# creating instance of IMDb
ia = imdb.IMDb()
   
# ID
code = "1187043"
   
# searching the Id
search = ia.get_movie(code)
  
# printing the search
print(search)


Output :

3 Idiots

Another example




# importing the module
import imdb
   
# creating instance of IMDb
ia = imdb.IMDb()
   
# ID
code = "4434004"
   
# searching the Id
search = ia.get_movie(code)
  
# printing the search
print(search)


Output :

Udta Punjab

Similar Reads

Python IMDbPY – Retrieving art department cast from the movie object
In this article we will see how we can retrieve the art department cast that involved in the movie from the movie information, movie id is the unique id given to each movie by IMDb. We can use search_movie method to search the movies by their name but it gives many movies as they have same names therefore retrieving a movie by its id is a better op
2 min read
Python IMDbPY - Retrieving actor from the movie details
In this article we will see how we can retrieve the actors name performed in the movie from the movie information, movie id is the unique id given to each movie by IMDb. We can use search_movie method to search the movies by their name but it gives many movies as they have same names therefore retrieving a movie by its id is a better option. In ord
2 min read
Python IMDbPY - Retrieving role played by actor from the movie details
In this article we will see how we can retrieve the role played by the actor in a given movie from the movie information, movie id is the unique id given to each movie by IMDb. We can use search_movie method to search the movies by their name but it gives many movies as they have same names therefore retrieving a movie by its id is a better option.
2 min read
Python IMDbPY – Getting released year of movie from movie object
In this article we will see how we can get the released year of movie from the movie object, we can get movie object with the help of search_movie and get_movie method to find movies. search_movie method returns list and each element of list work as a dictionary similarly get_movie method return a movie object which work as dictionary i.e. they can
2 min read
Python IMDbPY – Retrieving person using person ID
In this article we will see how we can retrieve the data of person using its person ID, person id is the unique id given to each person by IMDb. We can use search_person method to search the persons by their name but it gives many people as they have same names therefore retrieving a person by its id is a better option. In order to search a person
1 min read
Python IMDbPY – Retrieving company using company ID
In this article we will see how we can retrieve the data of company using its company ID, company id is the unique id given to each company by IMDb. We can use search_company method to search the companies by their name but it gives many companies as they have same names therefore retrieving a company by its id is a better option. In order to searc
1 min read
Python IMDbPY – Movie info set
IMDb data base have every information of the movie i.e when movie released, rating, locations etc but in order to retrieve them problem occur as there will be lots of web pages which can be both time-and bandwidth-consuming, especially if you’re interested in only a small part of the information. If we want to fetch only specific information we can
1 min read
Python IMDbPY – Default info of Movie object
In this article we will see how we can achieve the set of information which retrieved by default by get_movie method, with the help of get_movie_infoset we can know all the information that we can achieve of the movie. But all the information is not extracted as it will be time consuming process. In order to know the default information that a movi
1 min read
Python IMDbPY – Getting title from searched movie
In this article we will see how we can get the title of movie from the searched list of movies. We use search_movie method to find all the related movies. search_movie method returns list and each element of list work as a dictionary i.e. they can be queried by giving the key of the data, here key will be title. Syntax : movies[0][‘title’]Here movi
2 min read
Python IMDbPY – Getting movie ID from searched movies
In this article we will see how we can get the movie id from searched movies, movie id is basically unique id given to each movie as movie name can be same but id will be distinct. We use search_movie method to search movies with the same name. In order to get movie id we use movieID method. Syntax : movies[0].movieID Here movies is the list of mov
2 min read
Article Tags :
Practice Tags :