Search code examples
pythonpython-2.7google-booksisbn

How can I get the author and title by knowing the ISBN using Google Book API?


isbntools provides several useful methods and functions to validate, clean, transform, hyphenate and get metadata for ISBN strings.

isbntools documentation show how to get meta-data using Google Books:

$ isbn_meta ISBN goob

But that is an example of a command from the bash shell. How can I get the author and title by knowing the ISBN using Google Book API but calling a method from inside python code and not from the bash shell?


Solution

  • At some point, plugins for metadata and more stuff were moved into isbnlib. So now you can get metadata from ISBN like this:

    import isbnlib
    
    isbn = '9788177581805'
    
    book = isbnlib.meta(isbn)
    
    title = book['Title']
    authors = book['Authors]
    

    Here is the documentation for isbnlib which contains all the common functions that you may want to use.