C# Wrapper for the Riot Games API
##Features
- No need to worry about the 10 requests per 10s or the 500 requests per 10m rate limits, they are already implemented in the wrapper
- LINQ support
- Synchronous and asynchronous API
- Caching for the Static API
##Installation
Install RiotSharp through NuGet:
PM> Install-Package RiotSharp
or
-
Clone the repo (https://github.com/BenFradet/RiotSharp.git) or download the zip file.
-
Build the RiotSharp project and add the library to your own application.
##Usage
In order to use the api you need an api key which you can get here.
Entry point to the api:
var api = RiotApi.GetInstance("YOUR_API_KEY", false);
To get a summoner:
try
{
var summoner = api.GetSummoner(Region.euw, "StopOFlop");
}
catch(RiotSharpException ex)
{
//Handle the exception however you want.
}
To get the stats in ranked for a specific champion for this summoner:
try
{
var varusRanked = summoner.GetStatsRanked(Season.Season3)
.Where((s) => s.Name != null && s.Name.Equals("Varus"))
.FirstOrDefault();
}
catch(RiotSharpException ex)
{
//Handle the exception however you want.
}
foreach (var stat in varusRanked.Stats)
Console.WriteLine(stat.Name + " " + stat.Value);
For a full description check the RiotSharpExample or RiotSharpTest projects.
##Contribution
Simply send a pull request. When adding new features, please provide the related unit tests within the pull request.
##Libraries used
This wrapper uses Json.NET.
##License
This wrapper is under the MIT license.
##Disclaimer This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates.