Scores: list

Lists the scores in a leaderboard, starting from the top. Try it now.

Request

HTTP request

GET https://www.googleapis.com/games/v1/leaderboards/leaderboardId/scores/collection

Parameters

Parameter name Value Description
Path parameters
collection string The collection of scores you're requesting.

Acceptable values are:
  • "FRIENDS": List only scores of friends.
  • "PUBLIC": List all scores in the public leaderboard.
  • "SOCIAL": (Obsolete) Legacy G+ social scores. Use the FRIENDS collection instead.
leaderboardId string The ID of the leaderboard.
Required query parameters
timeSpan string The time span for the scores and ranks you're requesting.

Acceptable values are:
  • "ALL_TIME": List the all-time top scores.
  • "DAILY": List the top scores for the current day.
  • "WEEKLY": List the top scores for the current week.
Optional query parameters
language string The preferred language to use for strings returned by this method.
maxResults integer The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. Acceptable values are 1 to 30, inclusive.
pageToken string The token returned by the previous request.

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/games

For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "games#leaderboardScores",
  "nextPageToken": string,
  "prevPageToken": string,
  "numScores": long,
  "playerScore": {
    "kind": "games#leaderboardEntry",
    "player": players Resource,
    "scoreRank": long,
    "formattedScoreRank": string,
    "scoreValue": long,
    "formattedScore": string,
    "timeSpan": string,
    "writeTimestampMillis": long,
    "scoreTag": string
  },
  "items": [
    {
      "kind": "games#leaderboardEntry",
      "player": players Resource,
      "scoreRank": long,
      "formattedScoreRank": string,
      "scoreValue": long,
      "formattedScore": string,
      "timeSpan": string,
      "writeTimestampMillis": long,
      "scoreTag": string
    }
  ]
}
Property name Value Description Notes
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardScores.
nextPageToken string The pagination token for the next page of results.
prevPageToken string The pagination token for the previous page of results.
numScores long The total number of scores in the leaderboard.
playerScore nested object The score of the requesting player on the leaderboard. The player's score may appear both here and in the list of scores above. If you are viewing a public leaderboard and the player is not sharing their gameplay information publicly, the scoreRank and formattedScoreRank values will not be present.
playerScore.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardEntry.
playerScore.player nested object The player who holds this score.
playerScore.scoreRank long The rank of this score for this leaderboard.
playerScore.formattedScoreRank string The localized string for the rank of this score for this leaderboard.
playerScore.scoreValue long The numerical value of this score.
playerScore.formattedScore string The localized string for the numerical value of this score.
playerScore.timeSpan string The time span of this high score.
Possible values are:
  • "ALL_TIME" - The score is an all-time high score.
  • "WEEKLY" - The score is a weekly high score.
  • "DAILY" - The score is a daily high score.


Acceptable values are:
  • "ALL_TIME"
  • "DAILY"
  • "WEEKLY"
playerScore.writeTimestampMillis long The timestamp at which this score was recorded, in milliseconds since the epoch in UTC.
playerScore.scoreTag string Additional information about the score. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.
items[] list The scores in the leaderboard.
items[].kind string Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardEntry.
items[].player nested object The player who holds this score.
items[].scoreRank long The rank of this score for this leaderboard.
items[].formattedScoreRank string The localized string for the rank of this score for this leaderboard.
items[].scoreValue long The numerical value of this score.
items[].formattedScore string The localized string for the numerical value of this score.
items[].timeSpan string The time span of this high score.
Possible values are:
  • "ALL_TIME" - The score is an all-time high score.
  • "WEEKLY" - The score is a weekly high score.
  • "DAILY" - The score is a daily high score.


Acceptable values are:
  • "ALL_TIME"
  • "DAILY"
  • "WEEKLY"
items[].writeTimestampMillis long The timestamp at which this score was recorded, in milliseconds since the epoch in UTC.
items[].scoreTag string Additional information about the score. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.