Woudn't this require a huge number of web requests? If you played 2000 unique players you would need to load 2000 different api calls? I suppose it could cash the result of each player after each run, but it still sounds like a lot. Maprank doesn't even hit 100 api calls (though they have a large result set) until you have 20000 games. Actually it would be similar to some of the maprank code as you still need to get and parse all games played then you need to look up each unique player.
It would be be faster to get and store country flags from the scoreboard in large batches, but that's only for the current active players.