RiotGames / developer-relations

Riot Games Developer Ecosystem Bug Reporting
http://developer.riotgames.com
734 stars 44 forks source link

[BUG] Match history caps at less than 1000 even if games are less than two years old #957

Closed willissa2121 closed 3 weeks ago

willissa2121 commented 1 month ago

Bug Description
When querying match entires history, I only get ~930 games, even though they are not a full two years back.

Problem Description
I am attempting to get the entire history of league of legends matches per accounts. Currently this appears capped at ~1000, sometimes less

Expected Result
All game Ids are returned for several years prior

Actual Result
~930 results were returned

Developer Impact
This removes any capability to retrieve entire match history for an account

Preconditions
A valid riot developer API token generated

Repro Steps

  1. Query for any user with over 1000 games played in last two years
  2. Iterate over results, and notice less than 1000 results

If you're also experiencing this issue please add any additional context that is useful, the developer impact to yourself, and the player impact to your users. As an example, if spectator-v4 isn't working it might affect a scouting site, but it could also affect a mobile app or site to share replays. Give the context on how this issue affects your project.

willissa2121 commented 1 month ago

When querying with the PUUID above, I get 931 results, with the last resulting game being created on April 3rd

NA1_4620165195

$ cat app.js | tail -n10
async function main() {
  for (var i = 0; i < 20; i++) {
    const res = await axios.get(`https://americas.api.riotgames.com/lol/match/v5/matches/by-puuid/<PUUID>/ids?start=${100 * i}&count=100&api_key=<API_KEY>`)
    if(res.data.length != 0)data = [...data, ...res.data]
  }
  console.log(data[data.length-1])
  console.log(data.length)
}

main()

$ node app.js
NA1_4620165195
931
bangingheads commented 1 month ago

Match data is retained for 2 years, match timelines for 1 year. A player's match list will only show up to the last 1000 matches played. Non-public games (customs, practice tool, etc.) count towards the 1000 match limit so it may never hold exactly 1000. Games exceeding the limit but not exceeding the retention period will only be accessible through the match list of another player that participated in the game, or directly by the match id.

willissa2121 commented 1 month ago

I see, thanks for the clarity, that makes sense. Out of curiosity is it possible to get more than 1k games? I am trying to query data back to season 6

DarkIntaqt commented 1 month ago

That's not possible. Either 1000 games or 2 years back

willissa2121 commented 1 month ago

I see, that is very disappointing. Is it possible with a paid API token, or is this data just completely unavailable from RIOT?

Also feel free to close this bug, the documentation could use an update but this is operating as expected.

geozukunft commented 1 month ago

There is no such thing as a paid API those are the limits provided by Riot the only way to get more than 1000 games (but still max at 2 years) would be to download games from other players that were present in your games as long as they as well played less than 1000 games and through that way gather the matchids a rather complicated approach that gets less accurate the longer you wait obv

willissa2121 commented 1 month ago

But even if I queried other players who haven't played 1000 games, I would still only go back two years? So even with using other players in the game and fetching their history, is match data older than 2 years completely inaccessible?

I actually went down this path you mentioned, but haven't been able to get anything prior to June 2022.

geozukunft commented 1 month ago

Correct there is a hardcap at 2 years for match data and 1 year for timelines everything older than that gets deleted by Riot

willissa2121 commented 1 month ago

I see. Thanks for the clarity! Feel free to close this.

DarkIntaqt commented 1 month ago

Feel free to close this.

This is your issue, if you are not waiting for any further feedback you can close it yourself (button on the lower right at the "add a comment" section). If you are waiting for a response from riot, you can leave it open ofc