Betfair API : betfairlightweight (python wrapper)

User avatar
HRacing
Posts: 278
Joined: Tue May 14, 2013 11:25 am

Wed Jun 07, 2017 9:27 pm

Thankyou for ur patience linusP works perfectly

sa7med
Posts: 226
Joined: Thu May 18, 2017 8:01 am

Wed Mar 20, 2019 6:51 pm

hi...im trying to login with this, ive created and uploaded the proper certificates, they are in a folder 'certs' on the desktop.

When I try trading.login() i get the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
(response, elapsed_time) = self.request(self.url, session=session)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
self._error_handler(response_data)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
raise self._error(response)
betfairlightweight.exceptions.LoginError: API login: CERT_AUTH_REQUIRED

followed the documentation very closely. any ideas?

LinusP
Posts: 1533
Joined: Mon Jul 02, 2012 10:45 pm

Wed Mar 20, 2019 7:46 pm

sa7med wrote:
Wed Mar 20, 2019 6:51 pm
hi...im trying to login with this, ive created and uploaded the proper certificates, they are in a folder 'certs' on the desktop.

When I try trading.login() i get the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
(response, elapsed_time) = self.request(self.url, session=session)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
self._error_handler(response_data)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
raise self._error(response)
betfairlightweight.exceptions.LoginError: API login: CERT_AUTH_REQUIRED

followed the documentation very closely. any ideas?
What version are you running? Betfair recently updated the endpoints.

sa7med
Posts: 226
Joined: Thu May 18, 2017 8:01 am

Wed Mar 20, 2019 9:35 pm

LinusP wrote:
Wed Mar 20, 2019 7:46 pm
sa7med wrote:
Wed Mar 20, 2019 6:51 pm
hi...im trying to login with this, ive created and uploaded the proper certificates, they are in a folder 'certs' on the desktop.

When I try trading.login() i get the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
(response, elapsed_time) = self.request(self.url, session=session)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
self._error_handler(response_data)
File "C:\Python36\lib\site-packages\betfairlightweight\endpoints\login.
raise self._error(response)
betfairlightweight.exceptions.LoginError: API login: CERT_AUTH_REQUIRED

followed the documentation very closely. any ideas?
What version are you running? Betfair recently updated the endpoints.
i see, ill update now

mtrend
Posts: 66
Joined: Sun Sep 06, 2009 6:46 pm

Fri Apr 12, 2019 2:24 pm

Hi

I am trying to use this on a Windows 10 machine, i have created a folder C:\certs & put my .crt file in there, however when I run:

trading = betfairlightweight.APIClient(username=my_username,
password=my_password,
app_key=my_app_key,
certs=r'C:\certs')

I get the error:

betfairlightweight.exceptions.APIError: None
Params: None
Exception: Certificate folder not found in C:\certs

Process finished with exit code 1


Find it strange that is says 'Certificate folder not found' any ideas its driving me crazy !?



Cheers

LinusP
Posts: 1533
Joined: Mon Jul 02, 2012 10:45 pm

Fri Apr 12, 2019 3:05 pm

mtrend wrote:
Fri Apr 12, 2019 2:24 pm
Hi

I am trying to use this on a Windows 10 machine, i have created a folder C:\certs & put my .crt file in there, however when I run:

trading = betfairlightweight.APIClient(username=my_username,
password=my_password,
app_key=my_app_key,
certs=r'C:\certs')

I get the error:

betfairlightweight.exceptions.APIError: None
Params: None
Exception: Certificate folder not found in C:\certs

Process finished with exit code 1


Find it strange that is says 'Certificate folder not found' any ideas its driving me crazy !?



Cheers
Whats in the certs folder? It looks for .crt and .key:

https://github.com/liampauling/betfair/ ... nt.py#L150

mtrend
Posts: 66
Joined: Sun Sep 06, 2009 6:46 pm

Fri Apr 12, 2019 3:58 pm

Hi

I followed this:

https://docs.developer.betfair.com/disp ... n+With+XCA

Doesnt seem it lets you generate a .key file, Il see if I can do from the command prompt.

Cheers

sa7med
Posts: 226
Joined: Thu May 18, 2017 8:01 am

Fri Apr 12, 2019 4:03 pm

mtrend wrote:
Fri Apr 12, 2019 2:24 pm
Hi

I am trying to use this on a Windows 10 machine, i have created a folder C:\certs & put my .crt file in there, however when I run:

trading = betfairlightweight.APIClient(username=my_username,
password=my_password,
app_key=my_app_key,
certs=r'C:\certs')

I get the error:

betfairlightweight.exceptions.APIError: None
Params: None
Exception: Certificate folder not found in C:\certs

Process finished with exit code 1


Find it strange that is says 'Certificate folder not found' any ideas its driving me crazy !?




Cheers

Not sure if this is the problem but i think you need a '\' after certs ie certs=r'C:\certs\')

mtrend
Posts: 66
Joined: Sun Sep 06, 2009 6:46 pm

Fri Apr 12, 2019 4:27 pm

Im logging into the API now.

I had to export my certificate as a .PEM, then edit it and copy the key file section & create .key file from in notepad.

Cheers

Post Reply

Return to “Betfair API”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests