Author Topic: Lending Club API questions.  (Read 1996 times)

ernst20020530

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Lending Club API questions.
« on: April 23, 2015, 05:00:00 PM »
I have really confused about the new API. I am new guy for python, then I tried following


 req = urllib2.Request('https://api.lendingclub.com/api/investor/v1/accounts/111111/summary')  #111111 is my account ID
    try: response = urllib2.urlopen(req)
    except urllib2.URLError as e:
        print e.reason

But the code always failed with error code  "Unauthorized ".

what's wrong with the code.

mo

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Re: Lending Club API questions.
« Reply #1 on: April 25, 2015, 08:12:17 PM »
I have really confused about the new API. I am new guy for python, then I tried following


 req = urllib2.Request('https://api.lendingclub.com/api/investor/v1/accounts/111111/summary')  #111111 is my account ID
    try: response = urllib2.urlopen(req)
    except urllib2.URLError as e:
        print e.reason

But the code always failed with error code  "Unauthorized ".

what's wrong with the code.

If that is all your code one problem is you aren't setting the authentication header.  That would explain the unauthorized error.

https://www.lendingclub.com/developers/authentication.action