Goodreads Developers discussion

205 views
All users who have a book on their shelves

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

message 1: by Rob (new)

Rob (robca2) | 7 comments Can I use the API to get a list of all the users who have a book on one of their shelves? This would be the list that shows up in "Popular Shelves", for example when I click on "to-read" I get this list:

http://www.goodreads.com/shelf/users/...


message 2: by Michael (new)

Michael Economy (michaeleconomy) That query is very slow, we might be getting rid of that page.

What are you trying to build?


message 3: by Rob (new)

Rob (robca2) | 7 comments A map of which states a book is being read in.


message 4: by Michael (new)

Michael Economy (michaeleconomy) Ah, so if you jsut want to look for exclusive shelves (to-read/read/currently reading) we can probably do that.

So you want, given a work_id and an exclusive shelf name, a list of users that includes their locations?


message 5: by Rob (new)

Rob (robca2) | 7 comments Yes - work_id is a book identifier?

And yes, I don't care about custom shelves. (to-read/read/currently reading/all). "all" would be cool if it's available.


message 6: by Michael (new)

Michael Economy (michaeleconomy) All's even easier, I think we might already give out 40 or so people on this call: http://www.goodreads.com/api#book.show

But if you want people reading this book right now (currently-reading), i'd have to throw something together.


message 7: by Rob (new)

Rob (robca2) | 7 comments At first, I thought querying shelves would get me more data than querying reviews but it looks like I can't access the "read" shelf which is where most of the data is. Would that be included in "all"? Would it be available separately?

Making shelf a parameter would add more depth to the data. It would answer questions like "Where is To Kill a Mockingbird popular right now?" versus "Where has it been popular overall?"

However, there are a lot more reviews than I thought there would be and I could get a healthy amount of data based on reviews alone, at least for popular books. Book.Show displays 20 at a time. I could deal with that, as long as you don't mind that I iterate through num_pages (say, 100 API calls) in order to get all of the users.

Ideally, I would be able to query shelves. For now, I can query reviews while I build it out just as long as you don't ban me for iterating through all of the review pages for a popular book.


message 8: by Michael (new)

Michael Economy (michaeleconomy) Just stay within the 1 request a second limit and you'll be fine.

Thanks for sharing, I'll see if I can't cook up a more elegant solution for you.


message 9: by Rob (new)

Rob (robca2) | 7 comments What exactly is the "total" attribute in the tag? It seems to be the total number of users who have added the book to their library, whether or not they've written a review.

Also, book.show is working for me for now. It takes about 1 or 2 minutes to download the data for a popular book.


message 10: by Rob (new)

Rob (robca2) | 7 comments I think the "total" attribute in the tag in book.show is the total number of users because some of those people have NOT rated the book.

Also, book.show returns the names of shelves that the user has the book on, including "currently-reading" and even "read".

In other words, book.show seems to have all the data I want. It's just slow since it only returns 30 reviews per page.


message 11: by Michael (new)

Michael Economy (michaeleconomy) Thats correct.


message 12: by Rob (new)

Rob (robca2) | 7 comments I noticed it returns 30 records when I pull up the XML in a browswer, but when I make the call in JS it returns 20 records per page.


message 13: by Michael (new)

Michael Economy (michaeleconomy) That's a bug it looks like. Should be 30 for both now. Optionally you can pass in a per_page parameter (up to 100) to increase or decrease the page size.


back to top