LolHandbook.DataDragonClient 1.0.0

.NET Standard 2.0
NuGet\Install-Package LolHandbook.DataDragonClient -Version 1.0.0
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.
dotnet add package LolHandbook.DataDragonClient --version 1.0.0
<PackageReference Include="LolHandbook.DataDragonClient" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LolHandbook.DataDragonClient --version 1.0.0
#r "nuget: LolHandbook.DataDragonClient, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LolHandbook.DataDragonClient as a Cake Addin
#addin nuget:?package=LolHandbook.DataDragonClient&version=1.0.0

// Install LolHandbook.DataDragonClient as a Cake Tool
#tool nuget:?package=LolHandbook.DataDragonClient&version=1.0.0

Data Dragon Client

NuGet badge

.NET client library for Riot's Data Dragon API that provides access to information about champions and items in League of Legends. This library is a component of the League Handbook app but also available as a standalone NuGet package that can be used in any .NET project.

Disclaimer: This library isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc.

Quickstart

using LolHandbook.DataDragon;

IDataDragonClient client = new DataDragonClient("na");

// current patch version
string patchVersion = await client.GetPatchVersionAsync();

// champions
IDictionary<string, ChampionSummary> championSummaries = await client.GetChampionSummariesAsync();
ChampionSummary summary = championSummaries.Values.First(c => c.Name == "Annie");
ChampionDetail detail = await client.GetChampionDetailAsync(summary.Id);

// items
IDictionary<string, Item> items = await client.GetItemsAsync();

// summoner spells
IDictionary<string, SummonerSpell> summonerSpells = await client.GetSummonerSpellsAsync();

Caching

Since game data does not change often (new patches are typically released once every two weeks), it is beneficial to cache this data locally. A caching implementation is provided that will cache all calls except GetChampionDetailAsync. There is no built-in expiration mechanism, but you can manually invalidate the cache if needed.

var client = new CachingDataDragonClient("na");

// ... do stuff ...

// invalidate cache if you need to fetch new data
client.InvalidateCache();

Advanced configuration

When creating the client, you can pass in a custom RealmConfiguration that specifies one or more of the parameters below (anything that is not specified will use the default):

  • Cdn lets you override the default Data Dragon endpoint
  • PatchVersion lets you fetch data for an older patch version
  • Language lets you override the default language code for the realm

Example (specifying a patch version):

var configuration = new RealmConfiguration("na") { PatchVersion = "12.1.1" };
var client = new DataDragonClient(configuration);
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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.0.0 76 7/17/2022