Google Books is a Ruby wrapper to the Google Books API The project was inspired by google-book. It is a nice wrapper, however the Google Book Search Data API "is deprecated as of May 26, 2011 and will be fully retired on December 1, 2011."
The usage is similar to that of google-book, but the semantics are a little different
In addition to the query, the
GoogleBooks::API.search method takes in a hash of 3 different options:
count: The number of results that you want returned, currently the default is 10 (set by Google)
page: The page of results that you want. Combine this with
total_resultsmethod of the
GoogleBooks::API::Response, and implement paging in your application
api_key: For production apps, Google requires either OAuth 2.0 or an API key to request public data. See the API Documentation for more information.
Within your query that you pass to the search method, you can use special keywords as outlined in the API Documentation
intitle: Returns results where the text following this keyword is found in the title.
inauthor: Returns results where the text following this keyword is found in the author.
inpublisher: Returns results where the text following this keyword is found in the publisher.
subject: Returns results where the text following this keyword is listed in the category list of the volume.
isbn: Returns results where the text following this keyword is the ISBN number.
# Get the book with the isbn of 9781118035580 books = GoogleBooks::API.search('isbn:9781118035580') book = books.first puts book.title #=> "Hands - on ASP.NET AJAX Control Toolkit" puts book..first #=> "Damien White" (Shameless plug) puts book.covers[:thumbnail] #=> "http://bks7.books.google.com/books?id=..."
published_dateis represented by the format YYYY-MM-DD with MM and DD being optional
The keys are
Not all of the image URLs are guaranteed to return something. Stick with thumbnail or small for the best results