Goodreads Developers discussion
bugs
>
some URLs return 403 access forbidden
date
newest »


an example code to get access token
# example code to access the Goodreads API
def get_access_token(client_key,client_secret):
url = 'http://www.goodreads.com'
request_token_url = '%s/oauth/request_token' % url
authorize_url = '%s/oauth/authorize' % url
access_token_url = '%s/oauth/access_token' % url
# consumer authentication using oauth2
consumer = oauth2.Consumer(key= CLIENT_ID, secret= CLIENT_SECRET)
client = oauth2.Client(consumer) #create the client
# The OAuth Client request to get access token
response, content = client.request(request_token_url, 'GET')
if response['status'] != '200':
raise Exception('Invalid response: %s' % response['status'])
#get access token
request_token = dict(urllib.parse.parse_qsl(content))
oauth_token_key,oauth_token_secret = request_token[b'oauth_token'], request_token[b'oauth_token_secret']
return oauth_token_key, oauth_token_secret
# functions requiring access token for publishing or reading user profiles



There is also a good library that you can use
https://github.com/sefakilic/goodreads
If you are using python
I have been using my developer key to access Goodreads data but I have been running into 403 (access forbidden) response codes for URLs associated with certain userids but not for others, and I am wondering why.
For instance, this URL (with id=3061312) returns code 403:
https://www.goodreads.com/review/list...
While the following (with id=614778) successfully returns XML as expected:
https://www.goodreads.com/review/list...
I have a list of about 20 other users for which access is forbidden. I would really like to retrieve data for these users (for a thesis project) and do not understand why I cannot.
Any help would be appreciated, thank you,