betfairlightweight (python wrapper)

Post Reply
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

Just reached version 1.0 on betfairlightweight, I have added a simple tutorial to help anyone just getting started with the language/API.

https://underround.wordpress.com/

https://github.com/liampauling/betfairlightweight
User avatar
jimibt
Posts: 3641
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

cheers liam -much appreciated. even as a dyed in the wool c# .net dev, i get a lot from reading thro python code (and any other for that matter).

again, great work -thanks
poklius
Posts: 105
Joined: Sun May 17, 2009 11:58 am

Amazing work, thanks!
Arnold1
Posts: 8
Joined: Mon Apr 03, 2017 10:28 am

+1 thanks a lot, very useful CHEERS
User avatar
HRacing
Posts: 278
Joined: Tue May 14, 2013 11:25 am

Just wondered if anyone could help, iv managed to create a certificate to try and enable me to use LinusP's betfairlightweight however I
am still unable to log in. My certificate seems to have uploaded successfully.
You do not have the required permissions to view the files attached to this post.
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

What's the error / which file did you upload?
User avatar
HRacing
Posts: 278
Joined: Tue May 14, 2013 11:25 am

it seemes that i dont have the required .crt file to upload onto my account, i have the other 2 files that are requested but dont seem able to get the .crt file hmmm
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

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

right managed to get .crt file and uploaded to betfair. Ran there sample python code and got a successful log in with session token printed, yay :lol: .
However when i come to login via betfairlightweight it still says Exception: Certificate folder not found in /certs/. Be gentle :D
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

Lightweight assumes you have a folder at the top of your c drive /certs, you can either create this folder and place the certs in there or provide the location of your certs to the client:

https://github.com/liampauling/betfairl ... ent.py#L46
User avatar
HRacing
Posts: 278
Joined: Tue May 14, 2013 11:25 am

Thankyou for ur patience linusP works perfectly
sa7med
Posts: 800
Joined: Thu May 18, 2017 8:01 am

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: 1871
Joined: Mon Jul 02, 2012 10:45 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: 800
Joined: Thu May 18, 2017 8:01 am

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: 90
Joined: Sun Sep 06, 2009 6:46 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
Post Reply

Return to “Betfair Exchange API”