0

I have a question about the RiotGames API. I have an API Token from Riot Games and its limited to 10 Requests per second. However, when I want to read in game info with player Elo + Divisions, I need to do another request. With the in game info I only get champion runes masteries and so on, but I still need the elo, so I need to do another Request to the server.

By the time I have looped all 10 players, I have reached the API limit because I need to do the general request for a player list and then other requests for each player.

Klitos Kyriacou
  • 10,634
  • 2
  • 38
  • 70
Justin G.
  • 11
  • 7
  • 2
    so why not just delay a bit between the requests? – Sirko Feb 07 '16 at 22:54
  • Edited grammar and spelling and changed to the title to be more descriptive and follow an actual question structure. It would be super helpful if you could put the signatures of the API endpoints you are using here as well as the actual structure of the way you are calling all those endpoints in your program. – zero298 Feb 10 '16 at 00:21

1 Answers1

0

You could do some error handling to retry the request when you receive a response that says your limit has exceeded.

function request(player)
  response = riotGamesApi(player1)
  if response.status == "limit exceeded"
    response = request(player)
  else
    return response
  end
end

This will call itself recursively until you receive a valid response