Method: scores.get
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dapatkan skor tertinggi, dan secara opsional peringkat, di papan peringkat untuk pemain yang saat ini diautentikasi. Untuk jangka waktu tertentu, leaderboardId
dapat ditetapkan ke ALL
untuk mengambil data untuk semua papan peringkat dalam jangka waktu tertentu. `CATATAN: Anda tidak dapat meminta papan peringkat 'ALL' dan timeSpan 'ALL' dalam permintaan yang sama; hanya satu parameter yang dapat ditetapkan ke 'ALL'.
Permintaan HTTP
GET https://games.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}
Parameter jalur
Parameter |
playerId |
string
ID pemain. Nilai me dapat digunakan sebagai pengganti ID pemain yang diautentikasi.
|
leaderboardId |
string
ID papan peringkat. Dapat ditetapkan ke 'ALL' untuk mengambil data untuk semua papan peringkat untuk aplikasi ini.
|
timeSpan |
enum (ScoreTimeSpan )
Rentang waktu untuk skor dan peringkat yang Anda minta.
|
Parameter kueri
Parameter |
language |
string
Bahasa yang lebih disukai untuk digunakan untuk string yang ditampilkan oleh metode ini.
|
includeRankType |
enum (IncludeRankType )
Jenis peringkat yang akan ditampilkan. Jika parameter dihilangkan, tidak ada peringkat yang akan ditampilkan.
|
maxResults |
integer
Jumlah maksimum skor papan peringkat yang akan ditampilkan dalam respons. Untuk respons apa pun, jumlah skor papan peringkat yang sebenarnya yang ditampilkan mungkin kurang dari maxResults yang ditentukan.
|
pageToken |
string
Token yang ditampilkan oleh permintaan sebelumnya.
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons berisi instance GetLeaderboardScoresResponse
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
Untuk informasi selengkapnya, lihat Ringkasan OAuth 2.0.
ScoreTimeSpan
Menentukan kemungkinan rentang waktu untuk skor.
Enum |
ALL |
Dapatkan skor tertinggi untuk semua rentang waktu. Jika digunakan, nilai maxResults akan diabaikan. |
ALL_TIME |
Dapatkan skor tertinggi sepanjang masa. |
WEEKLY |
Cantumkan skor teratas untuk hari ini. |
DAILY |
Cantumkan skor teratas untuk minggu ini. |
IncludeRankType
Kemungkinan nilai untuk jenis peringkat.
Enum |
ALL |
Mengambil semua peringkat yang didukung. Di HTTP, nilai parameter ini juga dapat ditentukan sebagai ALL . |
PUBLIC |
Mengambil peringkat publik, jika pemain membagikan aktivitas gameplay-nya secara publik. |
SOCIAL |
(Tidak digunakan lagi) Mengambil peringkat sosial. |
FRIENDS |
Mengambil peringkat di koleksi teman. |
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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. |"]]