As well as sample code developed by Betfair, this page allows you to find sample code or documentation prepared by members of the Developer Program community. If you would like to contribute to this space, please contact firstname.lastname@example.org.
All Betfair developed sample code follows a typical work flow:
- Find the next UK Horse Racing Win market
- Get prices for the market
- Place a bet on the market
- Handle the error returned by the API when the bet fails as it is below the minimum stake size.
Please Note: In order to aide ease of understanding, the basic Betfair samples are not intended to show certain best practices for speed and throughput. Well designed applications should follow the best practices for client design of the application/language platform and should optimise on an HTTP request level with features such as requesting gzip'd responses and http connection keep alives. Please see Optimizing API Application Performance for further details.
The following samples are currently available:
Client Libraries & Sample Applications
|Language||Available From||Description||Developed By|
|Objective-C||https://github.com/betfair/aping-ios-sdk||iOS SDK library for Objective-C||Betfair|
|Excel/VBA||https://github.com/betfair/API-NG-Excel-Toolkit||Excel Sample Spreadsheet Application||Robin Barrett|
|Delphi||https://github.com/betfair/API-NG-Delphi-Client||API-NG Client Library for Delphi||Community member - khughes|
|Perl||https://github.com/MyrddinWyllt/WWW-BetfairNG||Perl Library for API-NG||Community member - Merlin|
|PHP||https://github.com/danieledangeli/betfair-php||API-NG Client Library for PHP||Community member - daniele8805|
|Python||https://github.com/jmcarp/betfair.py||Python wrapper for API-NG||Community member - jmcarp|
|Scala||https://github.com/city81/betfair-service-ng||Scala sample code for API-NG||Community member - theswan1|
|R||https://github.com/phillc73/abettor||Sample code for R||Community member - phill_c|