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

# QueryLeaderboardData

<Note>When the `access-token` is not included in the header, a maximum of 1000 records can be queried.</Note>

Arguments:

| Name | Description |
| - | - |
| `id` | Space id. |
| `first` | Query limit. |
| `cursorAfter` | You don't need to pass in this value on the first page. On the second page, you can start passing in the `endCursor` value returned by the first page. |
| `order` | Sort by Points/GalxeID. |
| `sprintId` | Query for season ranking. Overall ranking is null |

Request:

```graphql theme={null}
query SpaceLeaderboard(
  $id: Int!,
  $first: Int,
  $order: LoyaltyPointsRankOrder,
  $cursorAfter: String,
  $sprintId: Int
) {
  space(id: $id) {
    id
    name
    loyaltyPointsRanks(
      first: $first
      order: $order
      cursorAfter: $cursorAfter
      sprintId: $sprintId
    ) {
      pageInfo {
        startCursor
        endCursor
        hasNextPage
        hasPreviousPage
        __typename
      }
      totalCount
      edges {
        node {
          id
          rank
          points
          space {
            name
            __typename
          }
          address {
            username
            id
            avatar
            address
            solanaAddress
            aptosAddress
            seiAddress
            twitterUserName
            discordUserName
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

```

Variables:

```json theme={null}
{
  "id": 40,
  "first": 2,
  "cursorAfter": "Mg==",
  "order": "Points",
  "sprintId": null
}
```

Response:

```json theme={null}
{
  "data": {
    "space": {
      "id": "40",
      "name": "BNB Chain",
      "loyaltyPointsRanks": {
        "pageInfo": {
          "startCursor": "Mw==",
          "endCursor": "NA==",
          "hasNextPage": true,
          "hasPreviousPage": true,
          "__typename": "PageInfo"
        },
        "totalCount": 5509,
        "edges": [
          {
            "node": {
              "id": "lbrank-DJkB89vLsPMm44LuraURi8-40",
              "rank": 2,
              "points": 180,
              "space": {
                "name": "BNB Chain",
                "__typename": "Space"
              },
              "address": {
                "username": "DJkB89vLsPMm44LuraURi8",
                "id": "DJkB89vLsPMm44LuraURi8",
                "avatar": "https://cdn.galxe.com/galaxy/score/c6096a05-45f3-4427-8961-3326f9812ae1.png",
                "address": "0x1fa5b7fc4da7777d211ed41d31f8b84735fd41b1",
                "solanaAddress": "",
                "aptosAddress": "",
                "seiAddress": "",
                "twitterUserName": "",
                "discordUserName": "",
                "__typename": "Address"
              },
              "__typename": "LoyaltyPointsRank"
            },
            "__typename": "LoyaltyPointsRankEdge"
          },
          {
            "node": {
              "id": "lbrank-XHKvqqv82igAiiWjA7TEHH-40",
              "rank": 2,
              "points": 180,
              "space": {
                "name": "BNB Chain",
                "__typename": "Space"
              },
              "address": {
                "username": "tiepvien1111",
                "id": "XHKvqqv82igAiiWjA7TEHH",
                "avatar": "https://cdn.galxe.com/galaxy/score/30c28119-a45d-4591-ad22-436726404634.png",
                "address": "0x3739734419c979730fb0d0a4da42a840010e3cb1",
                "solanaAddress": "",
                "aptosAddress": "",
                "seiAddress": "",
                "twitterUserName": "",
                "discordUserName": "",
                "__typename": "Address"
              },
              "__typename": "LoyaltyPointsRank"
            },
            "__typename": "LoyaltyPointsRankEdge"
          }
        ],
        "__typename": "LoyaltyPointsRankConnection"
      },
      "__typename": "Space"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.