We are pleased to announce the second version of RiotSharp, our C# wrapper for the Riot Games API. In this post, I will detail the changes made to the wrapper.
We have made a change to how you get a reference to the RiotApi. If you do not own a production API key, you will have to proceed like so:
However, if you own a production API key, you will have to specify your rate limits:
Since it has been more than 2 months since the teams v2.2 and leagues v2.3 endpoints were deprecated, they have been disabled and, consequently, the methods linked to those endpoints have been removed.
The concerned methods are:
GetTeamsV22()
GetTeamsV22Async()
GetLeaguesV23()
GetLeaguesV23Async()
GetEntireLeaguesV23()
GetEntireLeaguesV23Async()
GetChallengerLeagueV23()
GetChallengerLeagueV23Async()
With the releases of the new teams v2.4 and leagues v2.5 endpoints the previous endpoints were deprecated (teams v2.3 and leagues v2.4).
As a result, a few methods were renamed:
GetTeams()
was renamed to GetTeamsV23()
GetTeamsAsync()
-> GetTeamsV23Async()
GetLeagues()
-> GetLeaguesV24()
GetLeaguesAsync()
-> GetLeaguesV24Async()
GetEntireLeagues()
-> GetEntireLeaguesV24()
GetEntireLeaguesAsync()
-> GetEntireLeaguesV24Async()
GetChallengerLeague()
-> GetChallengerLeagueV24()
GetChallengerLeagueAsync()
-> GetChallengerLeagueV24Async()
If you still want to use the deprecated endpoints, you will have to use those methods.
If you want access to those new endpoints, you will have to use the following renewed methods:
GetTeams()
GetTeamsAsync()
GetLeagues()
GetLeaguesAsync()
GetEntireLeagues()
GetEntireLeaguesAsync()
GetChallengerLeague()
GetChallengerLeagueAsync()
Thanks to the match endpoint, you will be able to retrieve information about a match with its id, the signatures of the new methods are:
The MatchDetail object will contain various information such as the map on which the match took place, the participants, etc.
Additionally, you are able to retrieve timeline data with the includeTimeline
parameter. If you choose to retrieve the timeline you will be able to see the
different events and at which point they occured during the game.
There is also a new matchHistory endpoint:
You will be able to navigate through the history of a player thanks to the
beginIndex
and endIndex
parameters. By default, they will return the last 15
matches for the players (indexed from 0 to 14). Keep in mind that the API will
only retrieve 15 matches per call so there is no need to have a
endIndex - beginIndex + 1
exceeding 15. For example if you wanted to retrieve
the 11th to 25th games but not the first 10:
You can also filter the matchHistory by champions played with the championIds
parameter. If you wanted to get the last 10 Annie matches played by someone:
Moreover, you can choose to only retrieve ranked games with the rankedQueues
parameter. As an example, if we wanted to get the last 5 matches in solo queue
for a specific summoner:
Those endpoints, contained in the lol static data endpoint, have been available for a long time in the API but they were not implemented in the wrapper because I didn’t think they were useful. However, someone recently requested them:
The versions endpoint returns a list of versions as a list of strings.
You can find information about what is returned by the realm endpoint on the official documentation for the API.
As usual, RiotSharp is available through nuget:
If you encounter issues working with the wrapper, log an issue on GitHub.