Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to retrieve IMDB movie ID from imdbpy?

The Python imdbpy module allows you search by movie title.

Example:


import imdb


ia = imdb.IMDb()

search_movie = ia.search_movie('Ready Player One')

Result:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


[<Movie id:1677720[http] title:_Ready Player One (2018)_>, <Movie id:8183756[http] title:_"Projector" Ready Player One (2018)_>, <Movie id:13695838[http] title:_"Big Pauly Talks Movies" Ready Player One (2018)_>, <Movie id:8045574[http] title:_"Ready Player One LIVE at SXSW" (2018)_>, ...]

How do grab the first Movie id from the results?

Tried:

  • While print(search_movie[0]['title']) brings back the title, these do not work:

    • print(search_movie[0]['Movie id'])
    • print(search_movie[0]['id'])

>Solution :

A quick check of the source code shows that you want print(search_movie[0]['movieID']) or print(search_movie[0].getID().

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading