Player Data Management - Get Player Statistics
Retrieves the current version and values for the indicated statistics, for the local player.
POST https://titleId.playfabapi.com/Server/GetPlayerStatistics
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-SecretKey | True |
string |
This API requires a title secret key, available to title admins, from PlayFab Game Manager. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
PlayFabId | True |
string |
user for whom statistics are being requested |
CustomTags |
object |
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
|
StatisticNameVersions |
statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be returned) |
||
StatisticNames |
string[] |
statistics to return |
Responses
Name | Type | Description |
---|---|---|
200 OK |
In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. |
|
400 Bad Request |
This is the outer wrapper for all responses with errors |
Security
X-SecretKey
This API requires a title secret key, available to title admins, from PlayFab Game Manager.
Type:
apiKey
In:
header
Definitions
Name | Description |
---|---|
Api |
The basic wrapper around every failed API response |
Get |
|
Get |
In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab. |
Statistic |
|
Statistic |
ApiErrorWrapper
The basic wrapper around every failed API response
Name | Type | Description |
---|---|---|
code |
integer |
Numerical HTTP code |
error |
string |
Playfab error code |
errorCode |
integer |
Numerical PlayFab error code |
errorDetails |
object |
Detailed description of individual issues with the request object |
errorMessage |
string |
Description for the PlayFab errorCode |
status |
string |
String HTTP code |
GetPlayerStatisticsRequest
Name | Type | Description |
---|---|---|
CustomTags |
object |
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
PlayFabId |
string |
user for whom statistics are being requested |
StatisticNameVersions |
statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be returned) |
|
StatisticNames |
string[] |
statistics to return |
GetPlayerStatisticsResult
In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab.
Name | Type | Description |
---|---|---|
PlayFabId |
string |
PlayFab unique identifier of the user whose statistics are being returned |
Statistics |
User statistics for the requested user. |
StatisticNameVersion
Name | Type | Description |
---|---|---|
StatisticName |
string |
unique name of the statistic |
Version |
number |
the version of the statistic to be returned |
StatisticValue
Name | Type | Description |
---|---|---|
StatisticName |
string |
unique name of the statistic |
Value |
number |
statistic value for the player |
Version |
number |
for updates to an existing statistic value for a player, the version of the statistic when it was loaded |