TheSportsDBClient 1.2.0
dotnet add package TheSportsDBClient --version 1.2.0
NuGet\Install-Package TheSportsDBClient -Version 1.2.0
<PackageReference Include="TheSportsDBClient" Version="1.2.0" />
<PackageVersion Include="TheSportsDBClient" Version="1.2.0" />
<PackageReference Include="TheSportsDBClient" />
paket add TheSportsDBClient --version 1.2.0
#r "nuget: TheSportsDBClient, 1.2.0"
#:package TheSportsDBClient@1.2.0
#addin nuget:?package=TheSportsDBClient&version=1.2.0
#tool nuget:?package=TheSportsDBClient&version=1.2.0
TheSportsDBClient
Unofficial C# client library for TheSportsDB API. Provides easy access to sports data including teams, players, leagues, events, and more.
Features
- Full coverage of TheSportsDB API endpoints
- Built-in retry logic with Polly
- Rate limiting support
- Strongly-typed responses
- Source Link enabled for easy debugging
Installation
From NuGet.org (Recommended)
dotnet add package TheSportsDBClient
Or via NuGet Package Manager:
Install-Package TheSportsDBClient
From GitHub Packages
GitHub Packages requires authentication even for public packages.
To setup system-wide access to repository:
Create a Personal Access Token (PAT) with
read:packagesscope at https://github.com/settings/tokensAdd GitHub Packages as a NuGet source:
dotnet nuget add source \
--username YOUR_GITHUB_USERNAME \
--password YOUR_GITHUB_PAT \
--store-password-in-clear-text \
--name github \
"https://nuget.pkg.github.com/bsv798/index.json"
- Install the package:
dotnet add package TheSportsDBClient --source github
To setup project-wide access to repository:
- Create a
nuget.configfile in your project root:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="github" value="https://nuget.pkg.github.com/bsv798/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="%GITHUB_USERNAME%" />
<add key="ClearTextPassword" value="%GITHUB_PAT%" />
</github>
</packageSourceCredentials>
</configuration>
Note environment variables GITHUB_USERNAME and GITHUB_PAT.
- Then install normally:
dotnet add package TheSportsDBClient
Quick Start
using TheSportsDBClient;
// Initialize the client with your API key
var client = new TheSportsDBClient("your-api-key");
// Search for a team
var teams = await client.SearchTeamsAsync("Arsenal");
// Get league details
var league = await client.GetLeagueByIdAsync(4328);
// Lookup player information
var player = await client.SearchPlayersAsync("Messi");
// Get upcoming events
var events = await client.GetNextEventsAsync(133604);
API Key
Get your free API key from TheSportsDB.
For development and testing, you can use the test API key: 123
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
-
net9.0
- HtmlAgilityPack (>= 1.12.4)
- Newtonsoft.Json (>= 13.0.4)
- Polly (>= 8.6.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.