|Table of Content Zone|
This documentation refers to the code available at https://github.com/betfair/API-NG-sample-code/tree/master/python.
A note on Python3:
We have added a python3 version of the json-rpc script, which is in the python subdirectory of the github sample code repo named ApiNgDemoJsonRpc-python3.py. This functions exactly the same way as the python 2.7X sample, but with compatibility tweaks for Python 3. The documentation below reflects the python 2.7X code, but the
You only need to clone or download the repository linked to above. If you do not have a valid Python 2.7.X installation already then please follow the download and installation instructions from
the python wiki.
Run the scripts
Change to the directory where you cloned the repository to and run the sample of your choice as follows:
python ApiNgDemoJsonRpc.py <appkey> <sessiontoken>
python ApiNgDemoRescript.py <appkey> <sessiontoken>
Calling API-NG with JSON-RPC
Method and param values need to be changed based on the required service operation.You can execute multiple service operation together with a single call using batch json-rpc call where you can correlate the responses with value of the id.
Calling API-NG with Rescript protocol
Get next available horse racing market and runner information using listMarketCatalogue
Get available price for the next horse racing market using listMarketBook
Placing a bet on first active runner from next horse racing market using placeOrders