Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In order to use the api you need an api key which you can get [here](https://dev

Entry point to the api if you do not own a production API key:
```c#
var api = RiotApi.GetInstance("YOUR_API_KEY");
var api = RiotApi.GetDevelopmentInstance("YOUR_API_KEY");
```

If you do own a production API key you can specify your own rate limits:
Expand All @@ -47,33 +47,14 @@ To get a summoner:
```c#
try
{
var summoner = api.GetSummoner(Region.euw, "StopOFlop");
var summoner = api.GetSummonerByName(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:
```c#
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);
}
```

You can find a list of all the available operations in [RiotApi in the documentation](http://benfradet.github.io/RiotSharp/api/RiotSharp.RiotApi.html).

### Tournament API
Expand Down Expand Up @@ -143,6 +124,28 @@ foreach (var champion in champions)
}
```

Additionally, you can use the regular api and static api to, for example, retrieve champion masteries for the summoner:
```c#
try
{
var championMasteries = api.GetChampionMasteries(RiotSharp.Misc.Region.na, summoner.Id);
}
catch (RiotSharpException ex)
{
// Handle the exception however you want.
}

foreach (var championMastery in championMasteries)
{
var id = championMastery.ChampionId;
var name = staticApi.GetChampion(RiotSharp.Misc.Region.euw, id).Name;
var level = championMastery.ChampionLevel;
var points = championMastery.ChampionPoints;

Console.WriteLine($" • **Level {level} {name}** {points} Points");
}
```

You can find a list of all the available operations in [StaticRiotApi in the Documentation](http://benfradet.github.io/RiotSharp/api/RiotSharp.StaticRiotApi.html).

### Status API
Expand Down