Goodreads Developers discussion

454 views
questions > review[review] max length?

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

message 1: by Robert (last edited Aug 01, 2012 02:21PM) (new)

Robert (rnekic) | 16 comments I'm calling the review.show_by_user_and_book API method to see if a user has an existing review for a particular book. If they don't have an existing review, they can enter text and I call the review create API. If they have an existing review, I display it and the user can edit the existing text and send it back to Goodreads via the review update API method. However, I'm confused regarding the max-length of the review text.

On the Goodreads website, the review text can be 20,000 characters. (BTW, there's actually bug there. The character counter is off by one and implies you can enter 20,001 character, but when you submit the form, validation logic enforces 20,000.)

So I can save a 20,000 character review via the web site but when I retrieve it via the API, the text I receive is truncated to around 296 characters(sometimes I get 297, sometimes 298.) The API then injects a hyperlink for "more..." I was not expecting that.

Also, the API docs page does not specify a max length but it appears the review create and review update APIs accept much longer values. I can send in longer reviews but when I turn around and re-load the text, it's truncated.

The Goodreads Android and iOS apps allow me to edit and then display the entire, long review text.

Am I using the wrong API to retrieve the existing review? Should I allow the user to see and update their star rating and shelf but always start with a blank review textbox and simply overwrite whatever they might have previously entered? Or should I limit my textbox to 295 characters and hope the user's mobile and web worlds don't collide?

I'm unsure how to proceed. Any suggestions?


message 2: by William, Goodreads engineer (last edited Aug 02, 2012 05:23PM) (new)

William Cline | 21 comments Mod
BTW, there's actually bug there. The character counter is off by one and implies you can enter 20,001 character, but when you submit the form, validation logic enforces 20,000.

Oops, thanks for catching that.

Am I using the wrong API to retrieve the existing review?

The ability to retrieve reviews' complete text was abused to the point where we had to disable it by default. Unfortunately, that creates an awkward situation if you want to let users edit existing reviews through your application.

You can request access to complete reviews using the instructions in the page I linked above. Another solution is to present your users with a Web browser frame displaying our HTML page for editing reviews. Our native iOS app. takes that approach in the handful of cases where we don't have an API method for something.

Edit: Hmm, except I would think we would still let a user edit her own reviews. Let me investigate some more...


message 3: by Robert (new)

Robert (rnekic) | 16 comments Yes, this would strictly be for reviews associated with the user ID I receive from the auth.user method.

I'll await further instruction; we can certainly request the access if that's the case.


message 4: by Robert (last edited Aug 03, 2012 06:56AM) (new)

Robert (rnekic) | 16 comments On a related note, if I send in a review with newlines (\n) in the the text, when I retrieve the review these are being returned as "br" tags.

Is this a side-effect of the process that is truncating and adding the "more" link? Will I get the original text if we are permitted to retrieve the entire review?


message 5: by William, Goodreads engineer (new)

William Cline | 21 comments Mod
Robert, it looks like there's no way to get the full text of a user's own reviews. I've ticketed this as a bug, but I can't give you any estimate of when it will be fixed.

If you want to offer this feature, then you should request full review access. See this thread, which I also linked above.

On a related note, if I send in a review with newlines (\n) in the the text, when I retrieve the review these are being returned as "br" tags.

The API returns sanitized review contents (only a subset of HTML allowed, line breaks converted to br tags, et cetera). There's no way to return the "raw" contents for editing, even for developers with full review access, which is another shortcoming that I have ticketed.

Sorry, I know that's inconvenient.


back to top