How to know if a live Featured Game(MATCHED_GAME) has ended in League Of Legends RIOT Api

Ashutosh :

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.

Adrien :

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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=106302&siteId=1