Goodreads Developers discussion

223 views
bugs > book.show JSON response different than XAML

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

message 1: by Shawn (new)

Shawn | 23 comments The json response from book.show returns only the widget while the xml returns much more. I'm assuming that the API is in flux due to yanking reviews from all the responses? I'm really hoping to use the JSON version instead of XML and would love to see the same data in both responses.

Here is the link I'm hitting:
http://www.goodreads.com/book/show?fo...

Thanks


message 2: by Michael (new)

Michael Economy (michaeleconomy) the json response is purposely shorter (smaller response for faster page loads), we might make an alternate expanded version of the json eventually, but probably not in the near term.


message 3: by Shawn (new)

Shawn | 23 comments That has a pretty funky code smell :)

I fully support the idea of smaller payloads but from everything I know of API design it's a bit confusing that when all you change is the message format you end up with different content. Most web sites that allow a variety of response formats don't change the actual content, just the packaging.

If the goal is to offer developers a way to get just the embed code why not add that as a param or a new resource (in REST speak), say book.widget? That way devs don't have to context switch back and forth between JSON or XML?

As a consolation prize can the help be updated to reflect this behavior?


message 4: by Michael (new)

Michael Economy (michaeleconomy) YEah, thats a good idea.


message 5: by William, Goodreads engineer (new)

William Cline | 21 comments Mod
It would help to know up front that currently the XML and JSON responses are different.

Indeed. :) The documentation for the book.show method will reflect this shortly.

Is the documentation only editable by the Goodreads staff? I am working to extend the Ruby API wrapper, and would love to help update documentation to reflect request/response information.

The docs. are only editable by GR staff, but we're happy to receive corrections/additions/revisions/suggestions by outside developers — as you've probably seen in other threads. That said, our time available for reviewing and incorporating submissions is pretty limited. So, I caution would-be contributors against sending us large revisions or additions. Full request/response examples for every method, for instance, might be nice, but it could be a long time before we vet them and incorporate them into the docs.

The docs. could definitely use more tending, Nate, and you are kind to offer to help. Can you tell me more about what updates you have in mind?


message 6: by William, Goodreads engineer (new)

William Cline | 21 comments Mod
Publishing your notes (output examples, et cetera) on GitHub as part of the Ruby API wrapper might be a good place to start. Maybe as part of a "HACKING" file or a set of wiki pages for developers working on that library. Making them part of an existing project increases the chance that more people will see and help maintain them. That would also make them something we could also link to from here in the developers group (in a sticky forum thread).

From there, with your permission, maybe I can copy some of the examples into the official Goodreads documentation. I hesitate to dump too much more info. into our docs without first cleaning up the design to make them more readable. But it's probably worth adding examples for some of the most commonly used methods.

Is it easy for you to adapt your notes for publication on GitHub like that? Does that seem like a good plan?

Again, I think it's great you're volunteering to help improve our docs — thank you. :) I just think it's a good idea to publish your work somewhere that doesn't completely depend on Goodreads, on top of whatever you send to us.


message 7: by Peter (new)

Peter Mitri (petermitri) | 50 comments Any plans on extending the json response?
I'm also moving to json for my mobile app. I'm particularly missing the "my_review" and "friend_reviews" fileds.


message 8: by Ashley (last edited Jun 12, 2013 12:54PM) (new)

Ashley (nosegraze) | 6 comments Just elaborating on this, following Twitter conversation with @Goodreads :

Here is another example of this:

http://www.goodreads.com/book/title?f...
The above XML formatted URL returns full book information, including image/title/author/series/etc.

You switch the format to JSON and get this:
http://www.goodreads.com/book/title?f...

Totally different stuff for "reviews_widget"


message 9: by William, Goodreads engineer (new)

William Cline | 21 comments Mod
Like Michael posted near the top of this thread, offering an expanded JSON response is not something we'll be able to do soon. Sorry. :\


back to top