> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to get internal player data

> Retrieve internal PlayFab player data from server APIs to access private fields that stay hidden from clients and remain secure to your title.

To get internal player data, use the Server API [GetUserInternalData](xref:titleid.playfabapi.com.server.playerdatamanagement.getuserinternaldata) method. This is *internal* data that you shouldn't\* expose it to the client.

The C# Sample in this article are written for the Unity SDK. The Unity SDK uses an event driven model to handle non-synchronous tasks. To run the sample code using the C# SDK, you must modify the code to use an async Task model. Methods that must be modified have Async append to the method name in the signature. For example, SetObject in the Unity SDK becomes SetObjectAsync in the C# SDK. For more information, see [Asynchronous programming with async and await](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/).

## C# code example

The following **C#** code example retrieves the Key Value Pairs of the player internal data.

```csharp theme={null}
public void GetUserInternalData() {
    PlayFabServerAPI.GetUserInternalData(new GetUserDataRequest() {
        PlayFabId = "user PlayFabId here - obtained from any successful LoginResult",
    },
    result => {
        if(result.Data == null || !result.Data.ContainsKey("Class")) Debug.Log("No Class");
        else Debug.Log("Class: " + result.Data["Class"].Value);
    },
    error => {
        Debug.Log("Got error getting internal user data:");
        Debug.Log(error.GenerateErrorReport());
    });
}
```

## See also

[How to set internal player data](/services/playfab/player-progression/player-data/how-to-set-internal-player-data)


## Related topics

- [How to set internal player data](/services/playfab/player-progression/player-data/how-to-set-internal-player-data.md)
- [Quickstart Player Data](/services/playfab/player-progression/player-data/quickstart.md)
- [PFPlayerDataManagementServerGetUserInternalDataGetResult](/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementservergetuserinternaldatagetresult.md)
- [PFPlayerDataManagementServerGetUserInternalDataAsync](/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementservergetuserinternaldataasync.md)
- [PFPlayerDataManagementServerGetUserPublisherInternalDataGetResult](/services/playfab/api-references/c/pfplayerdatamanagement/functions/pfplayerdatamanagementservergetuserpublisherinternaldatagetresult.md)
