Skip to content

efranford/RiotSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RiotSharp Stories in Ready

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

  1. Clone the repo (https://github.com/BenFradet/RiotSharp.git) or download the zip file.

  2. 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.

##Disclaimer This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates.

About

C# Wrapper for the Riot Games API

Resources

License

Stars

Watchers

Forks

Packages

No packages published