> For the complete documentation index, see [llms.txt](https://docs.luckyraccoongames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luckyraccoongames.com/really-simple-steam-integration/leaderboards/retrieving-leaderboard-data.md).

# Retrieving Leaderboard Data

You can still retrieve the data of a certain leaderboard and show it to the player. There are 3 ways to achieve this:

#### Global Top Scores

Retrieve a list of scores based on the best global scores:

```csharp
[SerializeField]
SteamLeaderboards steamLeaderboards;

IEnumerator AsyncGetLeaderboardEntries()
{
    steamLeaderboards.GetCurrentLeaderboardGlobal(1, 10); // 1st to 10th plyers

    while(steamLeaderboards.IsGettingLeaderboardEntries)
    {
        yield return null; // Wait until leaderdords data are fetched
    }

    // Wait a while for the avatar images to load or ignore this line
    // if you only want to get the player names
    yield return new WaitForSeconds(1.5f);

    foreach (SteamLeaderboardEntry leaderboardEntry in steamLeaderboards.LeaderboardEntries)
    {
        // Do whatever you want
    }
}
```

#### Scores Around Player

Retrieve a list of scores around player:

```csharp
[SerializeField]
SteamLeaderboards steamLeaderboards;

IEnumerator AsyncGetLeaderboardEntries()
{
    steamLeaderboards.GetCurrentLeaderboardGlobalAroundUser(-5, 5); // 5 before and 5 after player

    while(steamLeaderboards.IsGettingLeaderboardEntries)
    {
        yield return null; // Wait until leaderdords data are fetched
    }

    // Wait a while for the avatar images to load or ignore this line
    // if you only want to get the player names
    yield return new WaitForSeconds(1.5f);

    foreach (SteamLeaderboardEntry leaderboardEntry in steamLeaderboards.LeaderboardEntries)
    {
        // Do whatever you want
    }
}
```

#### Player And Friends

Retrieve the list of scores of the player and his friends

```csharp
[SerializeField]
SteamLeaderboards steamLeaderboards;

IEnumerator AsyncGetLeaderboardEntries()
{
    steamLeaderboards.GetCurrentLeaderboardFriends();

    while(steamLeaderboards.IsGettingLeaderboardEntries)
    {
        yield return null; // Wait until leaderdords data are fetched
    }

    // Wait a while for the avatar images to load or ignore this line
    // if you only want to get the player names
    yield return new WaitForSeconds(1.5f);

    foreach (SteamLeaderboardEntry leaderboardEntry in steamLeaderboards.LeaderboardEntries)
    {
        // Do whatever you want
    }
}
```

{% hint style="info" %}
The method AsyncGetLeaderboardEntries() is a Coroutine because calls to the Leaderboard API are asynchronous
{% endhint %}
