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 if you do not own a production API key:
var api = RiotApi.GetInstance("YOUR_API_KEY");
If you do own a production API key you can specify your own rate limits:
var api = RiotApi.GetInstance("YOUR_API_KEY",
your_rate_limit_per_10s, your_rate_limit_per_10m);
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. To run the unit tests you need to modify the App.config file and fill out the appropriate values so the tests can run.
Moreover, the documentation is far from perfect so every bit of help is more than welcome.
##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.