Lightweight python wrapper for Betfair API-NG
Maintained. Last release 3 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install betfairlightweightbetfairlightweight
Lightweight, super fast (uses C and Rust libraries) pythonic wrapper for Betfair API-NG allowing all betting operations (including market and order streaming) and account operations, see examples.
Currently tested on Python 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14.
installation
$ pip install betfairlightweight
To use C/Rust libraries install with
$ pip install betfairlightweight[speed]
setup
In order to connect to the Betfair API you will need an App Key, SSL Certificates and a username/password.
App Key
Follow these instructions to get your app key, you can either use a delayed or live key.
SSL certificates
Follow these instructions to set up your SSL certificates. Save your .ctr and .key files to a local directory. The default directory where the library is looking for the keys is '/certs' but you can specify any other directory.