Method: scores.get
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
現在認証されているプレーヤーのリーダーボードでハイスコアと、必要に応じてランクを取得します。特定の期間については、leaderboardId
を ALL
に設定して、その期間内のすべてのリーダーボードのデータを取得できます。「注: 同じリクエストで「ALL」のリーダーボードと「ALL」の期間をリクエストすることはできません。1 つのパラメータのみを「ALL」に設定できます。
HTTP リクエスト
GET https://games.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}
パスパラメータ
パラメータ |
playerId |
string
プレーヤー ID。認証済みのプレーヤーの ID の代わりに、me の値を使用できます。
|
leaderboardId |
string
リーダーボードの ID。「ALL」に設定すると、このアプリのすべてのリーダーボードのデータが取得されます。
|
timeSpan |
enum (ScoreTimeSpan )
リクエストするスコアとランクの期間。
|
クエリ パラメータ
パラメータ |
language |
string
このメソッドによって返される文字列に使用する優先言語。
|
includeRankType |
enum (IncludeRankType )
返されるランクのタイプ。このパラメータを省略すると、ランクは返されません。
|
maxResults |
integer
レスポンスで返されるリーダーボード スコアの最大数。レスポンスごとに、返されるリーダーボード スコアの実際の数は、指定された maxResults より少なくなる場合があります。
|
pageToken |
string
前のリクエストで返されたトークン。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功した場合、レスポンスの本文には GetLeaderboardScoresResponse
のインスタンスが含まれます。
認可スコープ
次のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
詳しくは、OAuth 2.0 の概要をご覧ください。
ScoreTimeSpan
列挙型 |
ALL |
すべての期間の最高スコアを取得します。このオプションを使用すると、maxResults の値は無視されます。 |
ALL_TIME |
歴代最高のスコアを獲得する。 |
WEEKLY |
当日の最高スコアを一覧表示します。 |
DAILY |
今週のトップスコアを一覧表示します。 |
IncludeRankType
列挙型 |
ALL |
サポートされているすべてのランクを取得します。HTTP では、このパラメータ値を ALL として指定することもできます。 |
PUBLIC |
プレーヤーがゲームプレイ アクティビティを一般公開している場合は、公開ランクを取得します。 |
SOCIAL |
(非推奨)ソーシャル ランクを取得します。 |
FRIENDS |
友達コレクションのランクを取得します。 |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 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. |"]]