Method: scores.get
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
קבל ניקוד גבוה, ובאופן אופציונלי דרגות, בלוחות לידרבורד עבור השחקן המאומת הנוכחי. עבור פרק זמן ספציפי, אפשר להגדיר את leaderboardId
לערך ALL
כדי לאחזר נתונים עבור כל לוחות הלידרבורד בפרק זמן נתון. 'הערה: לא ניתן לבקש לוחות Leaderboard מסוג 'ALL' ו-'ALL' timeSpan באותה בקשה. ניתן להגדיר רק פרמטר אחד כ-'ALL'.
בקשת HTTP
GET https://games.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}
פרמטרים של נתיב
פרמטרים |
playerId |
string
מזהה שחקן. ניתן להשתמש בערך me במקום מזהה הנגן המאומת.
|
leaderboardId |
string
מזהה הלידרבורד. ניתן להגדיר את הערך 'ALL' כדי לאחזר נתונים מכל לוחות הלידרבורד באפליקציה הזו.
|
timeSpan |
enum (ScoreTimeSpan )
טווח הזמן עבור הציונים והדירוגים שביקשת.
|
פרמטרים של שאילתה
פרמטרים |
language |
string
השפה המועדפת לשימוש במחרוזות שמוחזרות בשיטה הזו.
|
includeRankType |
enum (IncludeRankType )
סוגי הדרגות שצריך להחזיר. אם הפרמטר יושמט, לא יוחזרו דירוגים.
|
maxResults |
integer
המספר המקסימלי של ניקוד ב-Leaderboard שניתן להחזיר בתגובה. עבור כל תגובה, המספר של ציוני הלידרבורד שיוחזרו בפועל עשוי להיות נמוך מהערך שצוין ב-maxResults .
|
pageToken |
string
האסימון שהוחזר על ידי הבקשה הקודמת.
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התגובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכלול מופע של GetLeaderboardScoresResponse
.
היקפי הרשאות
כדי להשתמש בתכונה הזו יש צורך באחד מההיקפים הבאים של OAuth:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
למידע נוסף, עיין בסקירה הכללית על OAuth 2.0.
ScoreTimeSpan
הגדרת טווחי הזמן האפשריים לניקוד.
טיפוסים בני מנייה (enums) |
ALL |
קבלת התוצאות הגבוהות בכל הזמנים. במקרה כזה, המערכת תתעלם מערכי maxResults. |
ALL_TIME |
אפשר להשיג את התוצאה הגבוהה ביותר בכל הזמנים. |
WEEKLY |
רשימה של התוצאות המובילות ליום הנוכחי. |
DAILY |
רשימה של התוצאות המובילות לשבוע הנוכחי. |
IncludeRankType
ערכים אפשריים לסוג הדירוג.
טיפוסים בני מנייה (enums) |
ALL |
אחזור כל הדירוגים הנתמכים. ב-HTTP, אפשר לציין את ערך הפרמטר הזה גם כ-ALL . |
PUBLIC |
אחזור דירוגים ציבוריים, אם השחקן משתף את פעילות הגיימפליי שלו באופן ציבורי. |
SOCIAL |
(מיושן) אחזור הדרגה החברתית. |
FRIENDS |
מאחזרים את הדירוג באוסף החברים. |
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 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. |"]]