Sportradar.LiveData.Sdk 1.1.27

dotnet add package Sportradar.LiveData.Sdk --version 1.1.27
                    
NuGet\Install-Package Sportradar.LiveData.Sdk -Version 1.1.27
                    
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="Sportradar.LiveData.Sdk" Version="1.1.27" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sportradar.LiveData.Sdk" Version="1.1.27" />
                    
Directory.Packages.props
<PackageReference Include="Sportradar.LiveData.Sdk" />
                    
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 Sportradar.LiveData.Sdk --version 1.1.27
                    
#r "nuget: Sportradar.LiveData.Sdk, 1.1.27"
                    
#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 Sportradar.LiveData.Sdk@1.1.27
                    
#: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=Sportradar.LiveData.Sdk&version=1.1.27
                    
Install as a Cake Addin
#tool nuget:?package=Sportradar.LiveData.Sdk&version=1.1.27
                    
Install as a Cake Tool

Sportradar.LiveData.Sdk

Livedata SDK is a client library that enables easier integration with the Livedata (LiveScout) XML feed. The SDK exposes the XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing and dispatching. It also makes a client solution more stable and robust when it comes to feed handling, especially with the release of new and updated XML feed versions.

Contents

Installation

The package targets .NET 6 (net6.0, also usable from newer .NET versions) and .NET Framework 4.8 (net48).

dotnet add package Sportradar.LiveData.Sdk

or in your project file:

<PackageReference Include="Sportradar.LiveData.Sdk" Version="x.y.z" />

The SDK reads its settings from a dedicated section in your application's configuration file (App.config, or Web.config for web projects). In .NET 6+ projects, add an App.config file to the project root; the build copies it next to your executable as <YourApp>.dll.config.

Quick start

  1. Get your Common IAM credentials from your Sportradar contact (see Obtaining credentials).
  2. Add the SDK section to App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="Sdk" type="Sportradar.LiveData.Sdk.Services.SdkConfiguration.Sections.SdkConfigurationSection, Sportradar.LiveData.Sdk" />
  </configSections>

  <Sdk>
    <LiveScout Hostname="livedata.betradar.com" />
    <JwtAuth ClientId="xxx"
             Tenant="https://auth.sportradar.com/"
             Kid="xxx"
             PemPath="${LIVEDATA_PRIVATE_KEY_PATH}" />
  </Sdk>
</configuration>

configSections must be the first element inside configuration. Replace xxx with your values and point PemPath at your private key file (here via an environment variable).

  1. Initialize the SDK, start the LiveScout provider and subscribe to matches:
using System;
using System.Linq;
using System.Threading;
using Sportradar.LiveData.Sdk.Services;

internal static class Program
{
    private static void Main()
    {
        var sdk = Sdk.Instance;
        sdk.Initialize();   // reads the "Sdk" section from App.config
        sdk.Start();

        var liveScout = sdk.LiveScout;
        var opened = new ManualResetEventSlim();

        liveScout.OnOpened += (_, e) => { Console.WriteLine($"Connected {e.LocalTimestamp:O}"); opened.Set(); };
        liveScout.OnClosed += (_, e) => Console.WriteLine($"Disconnected {e.LocalTimestamp:O}");
        liveScout.OnLoginFailed += (_, e) => Console.WriteLine($"Login failed: {e.ErrorCode}");
        liveScout.OnFeedError += (_, e) => Console.WriteLine($"Feed error: {e.Cause} {e.ErrorMessage}");
        liveScout.OnMatchList += (_, e) =>
        {
            Console.WriteLine($"Match list with {e.MatchList.Length} matches");
            liveScout.Subscribe(e.MatchList.Select(m => m.MatchHeader.MatchId).Take(10));
        };
        liveScout.OnMatchUpdate += (_, e) =>
            Console.WriteLine($"Update for match {e.MatchUpdate.MatchHeader.MatchId}");

        liveScout.Start();

        if (opened.Wait(TimeSpan.FromSeconds(30)))
        {
            liveScout.GetMatchList(hours_back: 4, hours_fwd: 4);
        }

        Console.ReadLine();
        sdk.Stop();
    }
}

Login with Common IAM (CIAM)

The SDK authenticates against Sportradar Common IAM and logs in to the feed with the issued access token. Two Common IAM flows are supported:

Flow Config element When to use
Private Key JWT (recommended) <JwtAuth> Default for Service Accounts. You keep an RSA private key; no shared secret is sent over the wire.
Client secret <StandardOAuth> Only if your Sportradar contact issued a client ID and client secret instead of a key pair.

As soon as one of these elements is present in the Sdk section, the SDK uses Common IAM; ScoutUsername/ScoutPassword are then ignored. If both are configured, StandardOAuth wins.

Obtaining credentials

Service Accounts are not self-managed today; coordinate with your Sportradar contact:

  1. Generate an RSA key pair locally (PEM, 2048-bit recommended):

    openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out livedata-private.pem
    openssl rsa -in livedata-private.pem -pubout -out livedata-public.pem
    
  2. Share only the public key (livedata-public.pem) with Sportradar.

  3. Sportradar registers it and returns the Client ID and KID (key ID) via an approved secure channel (e.g. Keeper).

Keep the private key secret: never commit it and restrict file permissions to the account that runs your service. See the Common IAM Guide for the full Private Key JWT flow.

Private Key JWT (JwtAuth)

<Sdk>
  <LiveScout Hostname="livedata.betradar.com" />
  <JwtAuth ClientId="xxx"
           Tenant="https://auth.sportradar.com/"
           Kid="xxx"
           PemPath="/etc/livedata/livedata-private.pem" />
</Sdk>

JwtAuth is a child of Sdk, next to LiveScout (not inside it). All four attributes are required:

Attribute Value
ClientId Service Account ID (Common IAM client ID) provided by your Sportradar contact.
Tenant Common IAM domain, with a trailing slash. Production: https://auth.sportradar.com/; staging: https://stg-auth.sportradar.com/. The SDK appends oauth/token.
Kid Key ID assigned when your public key was registered in Common IAM.
PemPath Path to the unencrypted RSA private key in PEM format (PKCS#1 BEGIN RSA PRIVATE KEY or PKCS#8 BEGIN PRIVATE KEY). Supports ${ENV_VAR} placeholders.
Keeping the key path out of the config file

PemPath expands ${NAME} placeholders from the process environment when the SDK loads its settings. This lets you ship the same App.config to every environment and inject the key location at deploy time (Kubernetes secret mount, CI file variable, etc.):

<JwtAuth ClientId="xxx" Tenant="https://auth.sportradar.com/" Kid="xxx"
         PemPath="${LIVEDATA_PRIVATE_KEY_PATH}" />
export LIVEDATA_PRIVATE_KEY_PATH=/run/secrets/livedata-private.pem

If the variable is not set, the placeholder is left unchanged and the key file will not be found.

Client secret (StandardOAuth)

<Sdk>
  <LiveScout Hostname="livedata.betradar.com" />
  <StandardOAuth ClientId="xxx"
                 ClientSecret="xxx"
                 TokenEndpoint="https://auth.sportradar.com/" />
</Sdk>
Attribute Value
ClientId OAuth client ID provided by your Sportradar contact.
ClientSecret OAuth client secret provided by your Sportradar contact. Treat it like a password.
TokenEndpoint Common IAM domain, with a trailing slash (same values as Tenant above). The SDK appends oauth/token.

ClientSecret does not support ${ENV_VAR} expansion; protect the config file accordingly (e.g. generate it at deploy time).

Environments

Set Hostname on LiveScout explicitly when using Common IAM, and pair it with the matching IAM domain:

Environment IAM domain (Tenant / TokenEndpoint) LiveScout Hostname
Production https://auth.sportradar.com/ livedata.betradar.com
Staging (recommended for integration testing) https://stg-auth.sportradar.com/ livedata.betradar.dev

Staging example:

<Sdk>
  <LiveScout Hostname="livedata.betradar.dev" />
  <JwtAuth ClientId="xxx"
           Tenant="https://stg-auth.sportradar.com/"
           Kid="xxx"
           PemPath="${LIVEDATA_PRIVATE_KEY_PATH}" />
</Sdk>

Replay server: with Test="true" on LiveScout the SDK connects to the replay server (port 2047) and requests a token for the replay audience instead of the live feed. Use ILiveScout.SubscribeTest(...) to replay recorded matches there.

How the login works

On every (re)connect to the feed the SDK:

  1. Creates a short-lived client assertion (JWT signed with your private key, RS256, valid for one minute), or uses the client secret for StandardOAuth.
  2. Requests an access token from <IAM domain>oauth/token using the OAuth 2.0 client-credentials grant, for the livedata-feed audience (livedata-replay when Test="true").
  3. Sends the access token in the feed login message.

The access token is cached and reused on reconnects until shortly before it expires, so a flapping connection does not hammer Common IAM.

Requirements on your side:

  • Outbound HTTPS to the IAM domain, in addition to the feed host and port.
  • Accurate system clock (NTP). The client assertion is only valid for one minute, so a skewed clock makes Common IAM reject it.

Troubleshooting login

Subscribe to ILiveScout.OnLoginFailed; LoginFailedEventArgs.ErrorCode tells you what went wrong:

ErrorCode Meaning
no_access_token_Unauthorized Common IAM rejected the credentials: wrong ClientId/Kid, key not registered, wrong IAM domain for the environment, or clock skew.
no_access_token_<HttpStatus> (e.g. no_access_token_BadRequest) Common IAM returned another HTTP error.
no_access_token or no_access_token_ No token could be obtained at all: PEM file missing or unreadable, ${ENV_VAR} not set, IAM domain unreachable (network, proxy, firewall).
flooding Too many logins in a short time; the server blocks you temporarily.
Other values Rejected by the feed server's login reply (e.g. the Service Account has no access to the feed).

After an authentication failure the LiveScout provider stops and does not reconnect automatically. Check the SDK logs for the cause, fix the configuration, then call LiveScout.Stop() and LiveScout.Start() again (or restart your process).

If the JwtAuth or StandardOAuth element is present but an attribute is missing, Sdk.Instance.Initialize() throws SdkConfigException.

Legacy login (deprecated)

Username/password login is still available but deprecated and will be removed in the future. It is used only when neither JwtAuth nor StandardOAuth is configured:

<Sdk>
  <LiveScout ScoutUsername="xxx" ScoutPassword="xxx" />
</Sdk>

To migrate, request a Service Account from your Sportradar contact, add a JwtAuth element and remove ScoutUsername/ScoutPassword.

Usage

Initialize the SDK

Sdk.Instance.Initialize();

Overloads let you pass a different configuration section name and your own IDeadLetterQueue implementation to log or report messages and events the SDK could not deliver:

Sdk.Instance.Initialize("MySdkSection", new MyDeadLetterQueue());

Initialize throws SdkConfigException if the configuration is invalid. Accessing Sdk.Instance.LiveScout before Initialize throws InitException.

Start the SDK and register for global events

Sdk.Instance.OnQueueLimits += OnQueueLimits;
Sdk.Instance.Start();

Queue limit notifications alert you when the dispatcher queues start to congest (or have recovered), so you can react before messages pile up. Sdk.Instance.GetQueueStats() returns statistics for the underlying dispatcher queues.

Start the LiveScout provider and register for feed events

var liveScout = Sdk.Instance.LiveScout;

liveScout.OnOpened += OnOpened;
liveScout.OnClosed += OnClosed;
liveScout.OnLoginFailed += OnLoginFailed;
liveScout.OnFeedError += OnFeedError;
liveScout.OnMatchList += OnMatchList;
liveScout.OnMatchUpdate += OnMatchUpdate;
liveScout.OnMatchStop += OnMatchStop;
liveScout.OnScoutInfo += OnScoutInfo;
liveScout.OnMatchBookingReply += OnMatchBookingReply;
liveScout.OnMatchData += OnMatchData;
liveScout.OnLineups += OnLineups;

liveScout.Start();

The provider connects to the feed server, logs in and keeps the connection alive. If the connection drops, it reconnects automatically, re-subscribes your matches and informs you through OnClosed, OnFeedError and OnOpened. Event handlers run on SDK dispatcher threads, so keep them fast and thread-safe.

OnMatchUpdate delivers all match updates. Use OnMatchUpdateFull, OnMatchUpdateDelta and OnMatchUpdateDeltaUpdate if you want to handle the feed types separately.

Send requests

// Matches 4 hours back and 4 hours ahead; include_avail also returns matches open for booking.
liveScout.GetMatchList(hours_back: 4, hours_fwd: 4, include_avail: false);

// LiveScout sends no match data until you subscribe.
liveScout.Subscribe(new long[] { 12345678 });
liveScout.Unsubscribe(new long[] { 12345678 });

// Booking may incur costs depending on your agreement with Sportradar.
liveScout.BookEvents(new long[] { 12345678 });

Requests are rate-limited by the SDK according to the server limits; a call can block until it is allowed. Requests sent before OnOpened are not queued.

Stop

liveScout.Stop();
// unregister your handlers ...
Sdk.Instance.OnQueueLimits -= OnQueueLimits;
Sdk.Instance.Stop();

Sdk.Instance.Stop() also stops the LiveScout provider and logs out from the feed.

Note: The SDK is a singleton. Run only one active SDK instance per process. When using multiple processes (e.g. a failover setup), avoid running SDK instances in parallel with the same credentials; you may end up with inconsistent error-recovery state and run into server-side limits.

Configuration reference

All settings live in the Sdk section. Only authentication is required; everything else has defaults.

Element Purpose Common attributes
LiveScout Feed connection and protocol Hostname, Port, Test (replay server), UseSSL (default true), SSLThumbprint (optional leaf certificate pinning), MinReconnectWait, MaxReconnectWait, log levels
JwtAuth Common IAM, Private Key JWT ClientId, Tenant, Kid, PemPath
StandardOAuth Common IAM, client secret ClientId, ClientSecret, TokenEndpoint
Common Logging and queues LogPath (default logs), ExecutionLogLevel, QueueLowWatermark, QueueHighWatermark, QueueMaxCapacity
MessageDispatcher Event dispatching NumDispatchers (default 3), MaxDispatchEventsPerSecond

The feed and Common IAM connections use standard platform CA certificate validation; you do not need SSLThumbprint unless you want pinning. The full list of attributes and defaults is documented in the XML docs of the Sportradar.LiveData.Sdk.Services.SdkConfiguration.Sections namespace (visible via IntelliSense).

A complete example:

<Sdk>
  <Common LogPath="logs/sdk" ExecutionLogLevel="Info" />
  <LiveScout Hostname="livedata.betradar.com"
             TrafficLogLevel="Info"
             AlertLogLevel="Warn"
             ClientInteractionLogLevel="Warn" />
  <JwtAuth ClientId="xxx"
           Tenant="https://auth.sportradar.com/"
           Kid="xxx"
           PemPath="${LIVEDATA_PRIVATE_KEY_PATH}" />
</Sdk>

Logs

The SDK writes log files (log4net) under Common.LogPath. Logs are organized into categories: critical alerts, invalid messages, client interaction, configuration, statistics, message traffic and execution. Log levels are configured per category on Common and LiveScout (e.g. ExecutionLogLevel, AlertLogLevel, TrafficLogLevel). Token request and login failures are logged with their cause, which is the first place to look when OnLoginFailed fires.

Gotchas

The SDK generates an implicit "bet stop" after a disconnect and performs automatic error recovery. It does not keep track of bet clearings! If you are disconnected for a long time, the match may already be over when you come back. Bets were not accepted in that time frame (so you are safe), but you may still need to settle bets placed at the beginning of the match. In that (rare) case, re-subscribe to the match to receive a full match update and check MatchUpdate.MatchStatus to do correct pay-outs.

The SDK never generates an implicit "bet start". Do not rely on a bet start to resume accepting bets; check MatchHeader.BetStatus instead.

Data we collect

The SDK sends its version with the login so Sportradar can provide support and compatibility notices.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 Framework net48 is compatible.  net481 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.1.27 54 11/27/2026
1.1.26 82 11/25/2026
1.1.25 75 11/24/2026
1.1.24 83 11/24/2026
1.1.23 136 11/19/2026
1.1.22 460 9/24/2026
1.1.21 386 8/18/2026
1.1.20 1,750 4/29/2026
1.1.19 3,513 12/10/2025
1.1.18 1,244 11/26/2025
1.1.17 2,247 10/8/2025
1.1.16-beta 301 6/2/2025
1.1.15 9,108 4/8/2025
1.1.14 1,310 3/27/2025
1.1.13 820 3/25/2025
1.1.12 33,498 10/18/2024
1.1.11 1,368 8/23/2024
1.1.10 13,934 6/3/2024
1.1.10-beta 271 6/11/2024
1.1.9 2,427 3/11/2024
Loading failed

- Bug Fix: Corrected Common IAM TLS certificate validation by centralizing thumbprint and trust-store checks for TCP and dynamic-config HTTP connections (LDS-5970).
         - Technical Improvement: Added sliding-window queue metrics with .NET Metrics export and expanded Sdk.GetQueueStats() for SDK tools query (LDS-5147).
         - Technical Improvement: Refactored and extended the standalone QA TestApp for manual SDK validation (LDS-5736).
         - Vulnerability: Updated log4net, System.Security.Cryptography.Xml, BouncyCastle.Cryptography (net48), and related Microsoft.Extensions dependencies.
         - Technical Improvement: Upgraded LiveData DataModel to 1.0.364 (livedata-core 1.0.364).