Goodreads Developers discussion
API returns ‘Error: Forbidden’ - any idea why?
date
newest »



Using the OAuth I successfully create a session.
Test 1:
Get books without any filters with following call
response = session.get('https://www.goodreads.com/review/list...')
Return code is "200", but only books from my "to-read" shelf (all 10) are returned. No books from other shelves are listed.
Test 2:
Appending any parameters to the URL of the GET request results in error (even with just [above URL]?v=2 ).
The error code is 403 and content is
<error>forbidden</error>
How to select which shelf to list (or use any other parameters) when using OAuth session?
Any hints/ideas?

When using OAuth session in Python the get method takes path and parameters separately. The parameters have to be given as JSON object in 'params' parameter (e.g. params={'pname': val})
So to get contents of user's 'to-read' shelf, you would do:
path='https://www.goodreads.com/review/list...'
parm={'v': 2, 'id': 123456, 'shelf': 'to-read'}
response = session.get(path, params=parm)
A couple of days ago the API to get info from my own shelf stopped returning results. The only response I get is "forbidden".
I tried resetting my API key and secret, but that didn't help.
This the address I am trying to get results from, without key and secret:
https://www.goodreads.com/review/list...
Any idea why this is going on?