MikaelDui.RiotGames.Client
12.5.1.347
I've managed to get permabanned so I've ceased development on my Riot-related projects.
dotnet add package MikaelDui.RiotGames.Client --version 12.5.1.347
NuGet\Install-Package MikaelDui.RiotGames.Client -Version 12.5.1.347
<PackageReference Include="MikaelDui.RiotGames.Client" Version="12.5.1.347" />
paket add MikaelDui.RiotGames.Client --version 12.5.1.347
#r "nuget: MikaelDui.RiotGames.Client, 12.5.1.347"
// Install MikaelDui.RiotGames.Client as a Cake Addin #addin nuget:?package=MikaelDui.RiotGames.Client&version=12.5.1.347 // Install MikaelDui.RiotGames.Client as a Cake Tool #tool nuget:?package=MikaelDui.RiotGames.Client&version=12.5.1.347
Riot Games .NET Client (unofficial)
An unofficial .NET Client for Riot Games and their games League of Legends, Legends of Runeterra, Teamfight Tactics and Valorant.
✅ Purpose-built Open API client generator
✅ Vanilla C# - Code generation done with Roslyn.
✅ Auto-generated overloads for CLR objects.
✅ Continuously tested against the live API.
✅ All tests required to be successful before deploy.
✅ Performance tested - the extra classes have no measurable impact.
✅ Optimized - you call the HttpClient
almost directly.
✅ Embedded symbols and Source link - see the source code while debugging.
✅ Deterministic build - byte-for-byte output is identical across compilations.
❌ POST, PUT, DELETE and queries - for that, use other libraries for now (e.g. for RGAPI, Camille, and or LCU, PoniLCU).
❌ Game API - for that, use other libraries for now (e.g. Camille).
Sponsors
A big thank you for your support!
Demo
You can see the library running in your browser using Blazor at masteries.quest, which has a Cloudflare Workers proxy between the browser and Riot Games API.
Download
You can find the latest releases on GitHub Packages and on NuGet.org.
To install the latest version of the package, type the following in the package manager console:
Install-Package MikaelDui.RiotGames.Client
Or use the .NET CLI reference the latest stable and stay up-to-date:
dotnet add package MikaelDui.RiotGames.Client --version *
You can also use a PackageReference to stay up-to-date with the latest stable build:
<PackageReference Include="MikaelDui.RiotGames.Client" Version="*" />
Examples
Getting League of Legends masteries
using RiotGames.LeagueOfLegends;
using LeagueOfLegendsClient client = new("RGAPI-SUPERSECRET", Server.NA);
var summoner = await client.GetSummonerByNameAsync("Some summoner name");
var masteries = await client.GetMasteriesAsync(summoner);
foreach(var mastery in masteries)
Console.WriteLine($"Champion #{mastery.ChampionId}: {mastery.championPoints} points");
Getting Legends of Runeterra leadersboard
using RiotGames.LegendsOfRuneterra;
using LegendsOfRuneterraClient client = new("RGAPI-SUPERSECRET", RegionRoute.AMERICAS);
var leaderboards = await client.GetRankedLeaderboardsAsync();
foreach(var player in leaderboards.Players)
Console.WriteLine($"Player #{player.Name}: {player.Lp} LP");
Getting Teamfight Tactics league entires
using RiotGames.TeamfightTactics;
using TeamfightTacticsClient client = new("RGAPI-SUPERSECRET", PlatformRoute.NA1);
var leagueEntries = await client.GetLeagueEntriesAsync("some-summoner-ID");
foreach(var entry in leagueEntries)
Console.WriteLine($"Player #{entry.SummonerName}: {player.LeaguePoints} LP");
Getting a Valorant match
using RiotGames.Valorant;
using ValorantClient client = new("RGAPI-SUPERSECRET", ValPlatformRoute.EU);
var match = await client.GetMatchAsync("some-match-ID");
foreach(var player in match.Players)
Console.WriteLine($"Player #{player.Title} played champion #{player.ChampionId}");
Doing multi-game stuff
Using the RiotGamesClient
class gives you easy access to multiple game clients at once.
using RiotGames;
using RiotGamesClient client = new("RGAPI-SUPERSECRET", PlatformRoute.NA1, ValPlatformRoute.NA);
var lolSummoner = await client.LeagueOfLegends.GetSummonerByNameAsync("some-summoner-name");
var lolMasteries = await client.LeagueOfLegends.GetMasteriesAsync(summoner);
foreach(var mastery in lolMasteries)
Console.WriteLine($"Champion #{mastery.ChampionId}: {mastery.championPoints} points");
var lorLeaderboards = await client.LegendsOfRuneterra.GetRankedLeaderboardsAsync();
foreach(var player in lorLeaderboards.Players)
Console.WriteLine($"Player #{player.Name}: {player.Lp} LP");
Getting the current League of Legends champ select
You can use the LeagueClient
to communicate directly with the League Client (aka LCU).
using RiotGames.LeagueOfLegends.LeagueClient;
using LeagueClient.LeagueOfLegendsClient client = new();
var session = await client.ChampSelect.GetSessionAsync();
foreach(var teamMember in session.MyTeam)
{
var summoner = await client.Summoners.GetSummonerAsync(teamMember);
Console.WriteLine($"Team member: {summoner.DisplayName}");
}
Generated Code
The generated code looks like this:
Sub-packages
The client includes these sub-packages:
- MikaelDui.RiotGames.Core
- MikaelDui.RiotGames.LeagueOfLegends.Core
- MikaelDui.RiotGames.LeagueOfLegends.LeagueClient.LockFile
Notice from Riot Games
Riot Games .NET Client (unofficial) 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 Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Camille.Enums (>= 3.0.0-nightly-2022-03-03-9fe967ddf9)
- MikaelDui.Extensions (>= 1.0.26)
- MikaelDui.Net.UserAgent (>= 1.0.5)
- MikaelDui.Net.WebSockets.Extensions (>= 0.0.7)
- MikaelDui.Net.WebSockets.Wamp (>= 0.0.12)
- MikaelDui.RiotGames.Core (>= 1.0.4)
- MikaelDui.RiotGames.LeagueOfLegends.Core (>= 1.0.3)
- MikaelDui.RiotGames.LeagueOfLegends.LeagueClient.LockFile (>= 1.0.8)
-
.NETStandard 2.1
- Camille.Enums (>= 3.0.0-nightly-2022-03-03-9fe967ddf9)
- MikaelDui.Extensions (>= 1.0.26)
- MikaelDui.Net.UserAgent (>= 1.0.5)
- MikaelDui.Net.WebSockets.Extensions (>= 0.0.7)
- MikaelDui.Net.WebSockets.Wamp (>= 0.0.12)
- MikaelDui.RiotGames.Core (>= 1.0.4)
- MikaelDui.RiotGames.LeagueOfLegends.Core (>= 1.0.3)
- MikaelDui.RiotGames.LeagueOfLegends.LeagueClient.LockFile (>= 1.0.8)
-
net5.0
- Camille.Enums (>= 3.0.0-nightly-2022-03-03-9fe967ddf9)
- MikaelDui.Extensions (>= 1.0.26)
- MikaelDui.Net.UserAgent (>= 1.0.5)
- MikaelDui.Net.WebSockets.Extensions (>= 0.0.7)
- MikaelDui.Net.WebSockets.Wamp (>= 0.0.12)
- MikaelDui.RiotGames.Core (>= 1.0.4)
- MikaelDui.RiotGames.LeagueOfLegends.Core (>= 1.0.3)
- MikaelDui.RiotGames.LeagueOfLegends.LeagueClient.LockFile (>= 1.0.8)
-
net6.0
- Camille.Enums (>= 3.0.0-nightly-2022-03-03-9fe967ddf9)
- MikaelDui.Extensions (>= 1.0.26)
- MikaelDui.Net.UserAgent (>= 1.0.5)
- MikaelDui.Net.WebSockets.Extensions (>= 0.0.7)
- MikaelDui.Net.WebSockets.Wamp (>= 0.0.12)
- MikaelDui.RiotGames.Core (>= 1.0.4)
- MikaelDui.RiotGames.LeagueOfLegends.Core (>= 1.0.3)
- MikaelDui.RiotGames.LeagueOfLegends.LeagueClient.LockFile (>= 1.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.