question

Matthew Draper avatar image
Matthew Draper asked

Getting leaderboard position for large number of stats

Hi, we'd like to know if its possible (or advisable) to grab the player's leaderboard data for many (possibly hundreds) of stats at startup? We'd like the player to see all their game stats on one page, and their rankings for each stat in relation to other players. Maybe we should spread the queries out over time? Am I right in thinking there's no muilti-leaderboard query api?

Kind regards

-Mat

Leaderboards and Statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

It’s not recommended to grab all the stats at once, which means that you’ll potentially call GetLeaderboardAroundPlayer (If I understand it correctly) hundreds times in a short period of time as it will potentially throttle your title. Instead, here is a suggestion for your consideration:

  1. Use GetPlayerStatistics to get all the statistics for the player and show them on the page.
  2. When the player wants to know more details (position, relation to other players) about a specific leaderboard (statistic) , then use GetLeaderboardAroundPlayer to retrieve such info and show it on the page
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matthew Draper avatar image Matthew Draper commented ·

Thanks for the reply, that's a shame though because we also wanted to *sort* the stats by the player's rank, so the player sees their 'best' stats at the top of the page. Is there really no way to do this? Could the Leaderboards V2 api help, once released?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Matthew Draper commented ·

You can grab all the stats, however, you should control the request rate to avoid being throttled. And, it doesn't seem that leaderboard v2 would help, the feature you're asking sounds more like a feature request to me, you can make one here: https://community.playfab.com/spaces/24/index.html

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.