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 search a company by its id we use get_company method.

Syntax : imdb_object.get_company(id)

Argument : It takes string as argument which is company id

Return : It returns imdb Company object.



Below is the implementation.

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

Marvel Studios

Another example :

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

Pixel

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.