# Leaderboard: around() method

> The around() method of the Leaderboard interface resolves with a player's rank and the entries either side of theirs.

The **`around()`** method of the [`Leaderboard`](/docs/room/leaderboard) interface resolves with a player's rank in a period and the entries either side of theirs, or `undefined` when the player has no entry there.

## Syntax

```ts
around(player)
around(player, options)
```

### Parameters

`player`
: The player's ID.

`options` Optional
: An object with any of these properties:

  `period`
  : The period, as the [`Leaderboard`](/docs/room/leaderboard#description) page describes. Defaults to `"all"`.

  `count`
  : How many entries to give on each side of the player's, from 0 to 10. Defaults to 2.

### Return value

A `Promise` that resolves with `{ rank, entries }`, or `undefined`. `rank` is the player's rank, and `entries` holds the player's entry with up to `count` on each side, each as [`top()`](/docs/room/leaderboard/top) gives them.

### Exceptions

The promise rejects with a [`DataError`](/docs/room/data-error).

## Description

`around()` is never cached.

## Examples

### Showing a player their rivals

```ts
// rivals.ts
import { defineRoom } from "@irtio/room";

export default defineRoom({
  async onJoin(room, connection) {
    const near = await room.leaderboard("points").around(connection.player, { period: "month", count: 3 });
    if (near) room.send(connection, { type: "rivals", rank: near.rank, entries: near.entries });
  },
});
```

## See also

- [`Leaderboard.top()`](/docs/room/leaderboard/top)
