Goodreads Developers discussion

1653 views
questions > Getting the genre of a book

Comments Showing 1-13 of 13 (13 new)    post a comment »
dateDown arrow    newest »

message 1: by Becca (new)

Becca (ankhmorpork) | 2 comments Is there some way to the get the genre of a given book using the API? The only discussion concerning this is from 3 years ago - I'm wondering if there's been any progress on this.


message 2: by Vineet (new)

Vineet (vineetgarg) | 1 comments I would like to know this too. Give an ISBN or goodread id is there a way to get genre or top shelves associated with that book? I remember some API used to get this few months ago but I am able to figure that out now (API documentation isn't helpful)


message 3: by Alexis (new)

Alexis (lexish) | 12 comments I posted this in a similar thread like a month ago, but basically you need to use this endpoint to get the top shelves people have chosen for the book.


message 4: by Sahar (new)

Sahar Pirmoradian (spirmora) | 8 comments Using the Goodreads python library, I get popular shelves as:

gc = client.GoodreadsClient(Goodreads['key'], Goodreads['secret'])
book = gc.book(isbn=myisbn)
book.popular_shelves

By looking at the source code, I can see they call:

self._book_dict['popular_shelves']['shelf']


message 5: by Becca (new)

Becca (ankhmorpork) | 2 comments It seems like "genre" and "popular shelves" are slightly different though, as the top 2 popular shelves for the book posted by Alexis are "to-read" and "currently-reading", but the top 2 genres displayed on the book page are "Science Fiction" and "Fiction". So there's some sort of filtering going on of shelves that don't relate to the genre. I'd like to just get the genre information that Goodreads displays on the book page and not have to filter through all the manually created shelves.


message 6: by Alexis (new)

Alexis (lexish) | 12 comments yeah, there is no API that has that. That is some sort of Goodreads internal thing to generate canonical genres. It's pretty unfortunate.


message 7: by Sahar (new)

Sahar Pirmoradian (spirmora) | 8 comments I think you cannot directly do that - as also suggested by Alexis. Perhaps you should create a genre list, based on popular shelves of several books.


message 8: by Michael (new)

Michael Stoop | 2 comments A bit late to the party... I was just struggling with this as well. On the website of a book it lists Genres, and when you continue on to that it shows you all the shelves.

Take a look at "Discworld 22 The last Continent" (book id 47994).
On the website it shows
- Fantasy 3,033 users
- Fiction 545 users
- Humor 502 users

However; opening top shelves shows the following entries (from the top):
- to-read 10,389 people
- fantasy 3,033 people
- discworld 1,125 people
- fiction 545 people
- humor 502 people

It appears that there is some additional logic to "shelves" which is not part of the API result.
I'm working around this by just excluding some frequently occurring shelves, like "to-read", "own" etc.

My current list of omissions:
genreExceptions = [
'to-read', 'currently-reading', 'owned', 'default', 'favorites', 'books-i-own',
'ebook', 'kindle', 'library', 'audiobook', 'owned-books', 'audiobooks', 'my-books',
'ebooks', 'to-buy', 'english', 'calibre', 'books', 'british', 'audio', 'my-library',
'favourites', 're-read', 'general', 'e-books'
]

Obviously nowhere near complete, but it's a start.


message 9: by Jay (last edited Aug 16, 2018 05:04PM) (new)

Jay Moskowitz (chiefwizard) | 7 comments So it does appear that the genre of a book is not available through the API but it does not seem to appear even if you look up the book by name using the website. One potential option could be to look up a book using the Goodreads API then look for the book (perhaps by ISBN) on the Amazon website and extract the "Amazon Best Seller Rank" field that is returned. It does show the genre in which Amazon categorizes the book. Unfortunately, if you wish to learn of all books in a particular genre on Goodreads using this method, you are going to need to retrieve 700,000+ books on Goodreads then assign the genre from Amazon. I believe this would take over 8 days if limited to 1 transaction per second. But if API terms and conditions limits holding data for more than 24 hours, you could not complete this process in sufficient time.


message 10: by Priyanka (new)

Priyanka | 1 comments Hai all, i want to ask, something, how i can get all the list book?
When i try the example in api documentation, it give messge "invalid api permission".but when i try another method it going well


message 11: by Tin (new)

Tin Manasan | 2 comments Hello all, I know this has been asked, but I was just wondering if there are new updates concerning this topic. Or did anybody find. good solution for categorising book according to genre? is there a way I can link a book title to its top genre in Goodreads?

Thank you so much for your help.


message 12: by Archana (new)

Archana Harish | 1 comments Hello all,

Did anyone figure out a better way to get the "Genre" of the book based on book_id or isbn?

Thanks for your help.

Thanks,
Archana


message 13: by Megsie (new)

Megsie | 3 comments I don't think genre is available through the API yet-- but I'm waiting with bated breath to see if it is! A stop-gap measure I ended up using was getting "subject" through the OpenLibrary API, but that is not as consistent as the Goodreads data. Webscraping it was agonizing (as at least one other person has mentioned above). I really want them to include this as a feature! So. Fingers crossed.

Archana wrote: "Hello all,

Did anyone figure out a better way to get the "Genre" of the book based on book_id or isbn?

Thanks for your help.

Thanks,
Archana"



back to top