4

I'm getting the gameList(List[FeaturedGameInfo]) from the /lol/spectator/v4/featured-games api.

Now after querying matchv4 api at /lol/match/v4/matches/{matchId} with one of the live gameId from above gameList, no data is returned.

{
    "status": {
        "status_code": 404,
        "message": "Data not found"
    }
}

Although, it returns proper detailed data for past/non-live matches. But no data for live games.

So, I want to check if a match is currently live or not or if it has already ended.

I'm using V4 api.

dimwittedanimal
  • 656
  • 1
  • 13
  • 29
Kumar Ashutosh
  • 1,121
  • 10
  • 33

2 Answers2

2

In the riot api documentation you find the data that you search for and the links to get the data of the active games

https://developer.riotgames.com/docs/lol

EXMPL
GET ​https://127.0.0.1:2999/liveclientdata/activeplayer
GET ​https://127.0.0.1:2999/liveclientdata/playerlist
GET ​https://127.0.0.1:2999/liveclientdata/gamestats

1

As long as the game is not over, you'll receive the "Data not found" answer. If as soon as the game finishes, you receive the proper detailed data, then you can deduce if a game is live or not by the response to the /lol/match/v4/matches/{matchId} API.

Edit : I checked the documentation on this API. There is no mention of this API working on live games, and given the high number of values that can only be available after the game has ended, it really makes sense for the API to work only on ended games.

Adrien
  • 1,080
  • 4
  • 14