Friday, October 24, 2025
HomeLanguagesPython IMDbPY – Searching movies matching with keyword

Python IMDbPY – Searching movies matching with keyword

In this article we will see how we can find movies that have similar keyword. Keyword is a word (or group of connected words) attached to a title (movie / TV series / TV episode) to describe any notable object, concept, style or action that takes place during a title. The main purpose of keywords is to allow visitors to easily search and discover titles.
In order to get movies that have similar keywords we use get_keyword method. 

Syntax : imdb_object.get_keyword(keyword)
Argument : It takes string as argument i.e keyword
Return : It return list of movies object 
 

Below is implementation.  

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# keyword
keyword = "marvel"
  
# searching keyword
search = ia.get_keyword(keyword)
 
# printing the search
print(len(search))
print(search[0])


Output : 

50
Thor: Love and Thunder

Another example 

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# keyword
keyword = "heaven"
  
# searching keyword
search = ia.get_keyword(keyword)
 
# printing the search
print(len(search))
print(search[0])


Output : 

50
The Good Place (2016–2020))

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS