riot-games-api

Fetch Real-time data using Riot Api? Is it possible?


I am thinking about making an application that is run on a remote device (for example a phone), to gather and display data like: Summoner Name, Health, Kill/Death statistics, how long am I playing this current game etc.

Is it possible to use Riot Api to get this data and display it while playing a match?


Solution

  • Yes, you can request data for current matches by using the endpoint /lol/spectator/v4/active-games/by-summoner/{encryptedSummonerId}. For this you need the encrypted summoner id, which you can get with the endpoint /lol/summoner/v4/summoners/by-name/{summonerName}.

    The only real-time return value in this endpoint however is the elapsed time since the match started (gameLength). There is no other dynamic information.