How to get book cover from ISBN using Google Book API?

前端 未结 2 860
粉色の甜心
粉色の甜心 2021-01-30 09:06

Is there a simple way to get book cover in JSON format from ISBN using Google Book API?

相关标签:
2条回答
  • 2021-01-30 09:56

    You can use the isbn: query, like this:

    https://www.googleapis.com/books/v1/volumes?q=isbn:0771595158
    

    This will return a proper JSON response containing either the book information or an error description if the ISBN is not found.

    0 讨论(0)
  • 2021-01-30 10:07

    If you are looking for an answer for a Ruby (Rails, Sinatra or Console) answer on how to get a conver image or for that matter any detail available through the Google Books API, I think GoogleBooks gem is a good place to start.

    For example, for the same scenario:

    Install the gem

    gem install googlebooks
    

    Use the gem

    require 'googlebooks'
    GoogleBooks.search('isbn:9781443411080').first.image_link
    

    first because it returns a collection of books.

    0 讨论(0)
提交回复
热议问题