BetfairNG 1.6.1

dotnet add package BetfairNG --version 1.6.1
                    
NuGet\Install-Package BetfairNG -Version 1.6.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BetfairNG" Version="1.6.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BetfairNG" Version="1.6.1" />
                    
Directory.Packages.props
<PackageReference Include="BetfairNG" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BetfairNG --version 1.6.1
                    
#r "nuget: BetfairNG, 1.6.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BetfairNG@1.6.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BetfairNG&version=1.6.1
                    
Install as a Cake Addin
#tool nuget:?package=BetfairNG&version=1.6.1
                    
Install as a Cake Tool

Betfair API-NG C# Client API

A feature complete .NET Betfair API-NG C# client that builds on the Betfair sample code. It uses the Task Parallel Library and Reactive Extensions for the concurrency layer. Now with Exchange Streaming API support (early beta). Be sure to pull in the Betfair example code submodule:

git clone https://github.com/joelpob/betfairng
cd betfairng
git submodule init
git submodule update

How to use it

To login to Betfair using this library, you'll need both a) a self signed certificate (follow the process described here), and b) an application key directions here.

BetfairClient client = new BetfairClient("ASDF1234qwerty");
client.Login("client-2048.p12", "certpass", "username", "password");

Check out the ConsoleExample project (in the solution) for an example on how to use the "BetfairClient" class. If you're unfamiliar with the Task Parallel Library or Reactive Extensions, you can use the "BetfairClientSync" class.

The "MarketListener" class is where the magic happens:

AutoResetEvent waitHandle = new AutoResetEvent(false);
var marketListener = MarketListener.Create(client, BFHelpers.HorseRacePriceProjection(), 1);

var marketCatalogues = client.ListMarketCatalogue(
    BFHelpers.HorseRaceFilter(), 
    BFHelpers.HorseRaceProjection(), 
    MarketSort.FIRST_TO_START,
    25).Result.Response;
    
var marketCatalogue = marketCatalogues.First();

var marketSubscription = marketListener.SubscribeMarketBook(marketCatalogue.MarketId)
    .SubscribeOn(Scheduler.Default)
    .Subscribe(
    tick =>
    {
        Console.WriteLine(BFHelpers.MarketBookConsole(marketCatalogue, tick, marketCatalogue.Runners));
    },
    () =>
    {
        Console.WriteLine("Market finished");
        waitHandle.Set();
    });

waitHandle.WaitOne();
marketSubscription.Dispose();

MarketListener will poll the Betfair API-NG service (ListMarketBook) for all subscribed markets and push the result to all Rx subscribers. You can also subscribe to individual runners in a given market (MarketListener.SubscribeRunner()).

Enjoy.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.1 124 6/11/2026
1.6.0 102 6/11/2026
1.5.0 109 6/11/2026
1.4.2 144 2/26/2026
1.4.1 117 2/26/2026
1.4.0 210 12/21/2025
1.3.0 228 12/4/2025