Betfair.Interfaces
1.0.0-alpha-0
dotnet add package Betfair.Interfaces --version 1.0.0-alpha-0
NuGet\Install-Package Betfair.Interfaces -Version 1.0.0-alpha-0
<PackageReference Include="Betfair.Interfaces" Version="1.0.0-alpha-0" />
<PackageVersion Include="Betfair.Interfaces" Version="1.0.0-alpha-0" />
<PackageReference Include="Betfair.Interfaces" />
paket add Betfair.Interfaces --version 1.0.0-alpha-0
#r "nuget: Betfair.Interfaces, 1.0.0-alpha-0"
#:package Betfair.Interfaces@1.0.0-alpha-0
#addin nuget:?package=Betfair.Interfaces&version=1.0.0-alpha-0&prerelease
#tool nuget:?package=Betfair.Interfaces&version=1.0.0-alpha-0&prerelease
Betfair
Fast and simple classes for interacting with the Betfair API and Stream.
I'm passionate about this library and love hearing from users! Join our Discussions to ask questions, share your experiences, or suggest new features. Your feedback helps make this library better for everyone.
Installation
Available on NuGet
dotnet add package Betfair
or
PM> Install-Package Betfair
How to Subscribe to a Market Stream
Create a Subscription, define your filters, and run the zero-allocation market cache.
Full subscription documentation.
var credentials = new Credentials("USERNAME", "PASSWORD", "APP_KEY");
using var subscription = new Subscription(credentials);
var filter = new StreamMarketFilter().WithMarketIds("MARKET_ID");
var data = new DataFilter().WithBestPrices().WithLastTradedPrice();
await subscription.RunMarketCache(filter, data, onUpdate: processor =>
{
var market = processor.GetMarket("MARKET_ID");
if (market is null) return;
foreach (var runner in market.RunnerSpan)
{
var bestBack = runner.BestAvailableToBack.GetPrice(0);
var bestLay = runner.BestAvailableToLay.GetPrice(0);
// React to price changes with minimal latency
}
}, cancellationToken: cts.Token);
Optional Logging
Enable structured logging of connection lifecycle events (connect, reconnect, errors) by passing a logger:
using var subscription = new Subscription(credentials, new SubscriptionOptions
{
Logger = loggerFactory.CreateLogger<Subscription>()
});
How to List Today's Horse Races
var credentials = new Credentials("USERNAME", "PASSWORD", "APP_KEY");
using var client = new BetfairApiClient(credentials);
var filter = new ApiMarketFilter()
.WithMarketTypes(MarketType.Win)
.WithCountries(Country.UnitedKingdom, Country.Ireland)
.WithEventTypes(EventType.HorseRacing)
.FromMarketStart(DateTimeOffset.UtcNow)
.ToMarketStart(DateTimeOffset.UtcNow.AddDays(1));
var query = new MarketCatalogueQuery()
.Include(MarketProjection.Event)
.Include(MarketProjection.MarketStartTime)
.Include(MarketProjection.MarketDescription)
.Include(MarketProjection.RunnerDescription)
.OrderBy(MarketSort.FirstToStart)
.Take(200);
var marketCatalogues = await client.MarketCatalogue(filter, query);
Or use the helper extension.
var filter = new ApiMarketFilter()
.TodaysCard();
var query = new MarketCatalogueQuery()
.Include(MarketProjection.Event)
.Include(MarketProjection.MarketStartTime)
.Include(MarketProjection.MarketDescription)
.Include(MarketProjection.RunnerDescription)
.OrderBy(MarketSort.FirstToStart)
.Take(200);
var marketCatalogues = await client.MarketCatalogue(filter, query);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 is compatible. 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. |
-
net10.0
- No dependencies.
-
net8.0
- System.Text.Json (>= 9.0.7)
-
net9.0
- No dependencies.
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.0.0-alpha-0 | 90 | 7/8/2026 |