Method: scores.get
Stay organized with collections
Save and categorize content based on your preferences.
Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId
can be set to ALL
to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.
HTTP request
GET https://games.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}
Path parameters
Parameters |
playerId |
string
A player ID. A value of me may be used in place of the authenticated player's ID.
|
leaderboardId |
string
The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.
|
timeSpan |
enum (ScoreTimeSpan )
The time span for the scores and ranks you're requesting.
|
Query parameters
Parameters |
language |
string
The preferred language to use for strings returned by this method.
|
includeRankType |
enum (IncludeRankType )
The types of ranks to return. If the parameter is omitted, no ranks will be returned.
|
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 .
|
pageToken |
string
The token returned by the previous request.
|
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of GetLeaderboardScoresResponse
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
For more information, see the OAuth 2.0 Overview.
ScoreTimeSpan
Defines possible time spans for a score.
Enums |
ALL |
Get the high scores for all time spans. If this is used, maxResults values will be ignored. |
ALL_TIME |
Get the all time high score. |
WEEKLY |
List the top scores for the current day. |
DAILY |
List the top scores for the current week. |
IncludeRankType
Possible values for rank type.
Enums |
ALL |
Retrieve all supported ranks. In HTTP, this parameter value can also be specified as ALL . |
PUBLIC |
Retrieve public ranks, if the player is sharing their gameplay activity publicly. |
SOCIAL |
(Obsolete) Retrieve the social rank. |
FRIENDS |
Retrieve the rank on the friends collection. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-10-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-28 UTC."],[],[],null,["# Method: scores.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [ScoreTimeSpan](#ScoreTimeSpan)\n- [IncludeRankType](#IncludeRankType)\n- [Try it!](#try-it)\n\nGet high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, `leaderboardId` can be set to `ALL` to retrieve data for all leaderboards in a given time span. \\`NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}`\n\n### Path parameters\n\n| Parameters ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `playerId` | `string` A player ID. A value of `me` may be used in place of the authenticated player's ID. |\n| `leaderboardId` | `string` The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. |\n| `timeSpan` | `enum (`[ScoreTimeSpan](/games/services/web/api/rest/v1/scores/get#ScoreTimeSpan)`)` The time span for the scores and ranks you're requesting. |\n\n### Query parameters\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `language` | `string` The preferred language to use for strings returned by this method. |\n| `includeRankType` | `enum (`[IncludeRankType](/games/services/web/api/rest/v1/scores/get#IncludeRankType)`)` The types of ranks to return. If the parameter is omitted, no ranks will be returned. |\n| `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`. |\n| `pageToken` | `string` The token returned by the previous request. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [GetLeaderboardScoresResponse](/games/services/web/api/rest/v1/scores#GetLeaderboardScoresResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/games`\n- `\n https://www.googleapis.com/auth/games_lite`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).\n\nScoreTimeSpan\n-------------\n\nDefines possible time spans for a score.\n\n| Enums ||\n|------------|---------------------------------------------------------------------------------------------|\n| `ALL` | Get the high scores for all time spans. If this is used, maxResults values will be ignored. |\n| `ALL_TIME` | Get the all time high score. |\n| `WEEKLY` | List the top scores for the current day. |\n| `DAILY` | List the top scores for the current week. |\n\nIncludeRankType\n---------------\n\nPossible values for rank type.\n\n| Enums ||\n|-----------|---------------------------------------------------------------------------------------------|\n| `ALL` | Retrieve all supported ranks. In HTTP, this parameter value can also be specified as `ALL`. |\n| `PUBLIC` | Retrieve public ranks, if the player is sharing their gameplay activity publicly. |\n| `SOCIAL` | (Obsolete) Retrieve the social rank. | This item is deprecated! |\n| `FRIENDS` | Retrieve the rank on the friends collection. |"]]