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

# Leaderboards Metadata API

> Find out what each type of score in a game means. This API does not return scores or rankings.

Licensed

> [!NOTE]
>
> Leaderboards are only available with the licensed model. [Contact us](https://business.gamezop.com/contact-us/enquire-now) to know more.

In Gamezop, a **Leaderboard** is a category that a score belongs to, such as a game's "easy" or "hard" mode. It is not a ranked list of players. This API lists the Leaderboards that exist for a game, so you can tell what each score you receive means. It never returns scores or rankings.

## What is a Leaderboard?

Take an endless runner game with 2 modes: "easy" and "hard". A score of 500 in easy mode can't be fairly compared with a score of 500 in hard mode, so the game has 2 Leaderboards, one for each mode.

Scores you receive through [server-side webhooks](https://docs.platform.gamezop.com/publishers/gamezop/offerings/individual-games/server-side-webhooks.md) and [client-side callbacks](https://docs.platform.gamezop.com/publishers/gamezop/offerings/individual-games/client-side-callbacks.md) include the ID of the Leaderboard they were recorded against. Use this API to look up what that Leaderboard is: in this example, whether the score came from easy or hard mode.

If you want to show your users a ranked list of scores, you build it yourself from the scores you receive, keeping each Leaderboard separate.

> [!NOTE]
>
> Most games have a single Leaderboard. You mainly need this API for games that have more than one.

***

## What this API returns

For the game you ask about, the API returns a list of its Leaderboards. Each Leaderboard in the list contains:

| Field | What it tells you |
| :- | :- |
| `leaderboard_id` | The Leaderboard's unique ID. This is the ID that comes with each score you receive. |
| `name` | The Leaderboard's name in English, such as "Score leaderboard". You can show it to your users. |
| `description` | A short English description of the Leaderboard. You can show it to your users. |
| `score_type` | The kind of value recorded as a score: `number` or `percent`. |
| `sorting_order` | Which scores are better, for when you build your own rankings: `ascending` means a higher score is better, and `descending` means a lower score is better. |

If the game has no Leaderboards, the list is empty.

***

## Where to get the scores themselves

> [!WARNING]
>
> **This API does not return user scores or rankings.** To get the scores themselves, use one of the pages below.

| To get | Use |
| :- | :- |
| Individual Games scores in your backend | [Server-side webhooks](https://docs.platform.gamezop.com/publishers/gamezop/offerings/individual-games/server-side-webhooks.md) |
| Individual Games scores in your app or website, as they happen | [Client-side callbacks for Individual Games](https://docs.platform.gamezop.com/publishers/gamezop/offerings/individual-games/client-side-callbacks.md) |
| Battles winners and match results in your backend | [Track Battle match outcomes](https://docs.platform.gamezop.com/publishers/gamezop/offerings/battles/integration/match-outcomes.md) or the [Get Match Result API](https://docs.platform.gamezop.com/publishers/gamezop/offerings/battles/integration/get-match-result-api.md) |
| Battles scores and results in your app or website, as they happen | [Client-side callbacks for Battles](https://docs.platform.gamezop.com/publishers/gamezop/offerings/battles/integration/client-side-callbacks.md) |
| Tournament rankings while a tournament is running | [Live Leaderboard API](https://docs.platform.gamezop.com/publishers/gamezop/offerings/tournaments/integration/live-leaderboard.md) |
| Tournament rankings after a tournament ends | [Final Results API](https://docs.platform.gamezop.com/publishers/gamezop/offerings/tournaments/integration/final-results.md) |

***

## List a game's Leaderboards

Pass the game's `code` from the [All Games API](https://docs.platform.gamezop.com/publishers/gamezop/guides/all-games-api.md) as the `game-code` query parameter. The request format and an example response are in the API reference on this page.

***


## OpenAPI

````yaml openapi-gzp.json GET /v3/leaderboards-metadata
openapi: 3.1.0
info:
  title: Gamezop APIs
  version: 1.0.0
  description: >-
    OpenAPI specification for Gamezop endpoints including game catalog,
    leaderboard metadata, and other integration APIs.
servers:
  - url: https://api.gamezop.com
    description: Gamezop API
security:
  - bearerAuth: []
paths:
  /v3/leaderboards-metadata:
    get:
      summary: Leaderboards Metadata API
      description: >-
        Some games may have multiple types of scores. You can use The
        Leaderboard Metadata API to understand what each of those score values
        represents in the context of the game.
      operationId: listLeaderboardsMetadata
      parameters:
        - name: game-code
          in: query
          required: true
          description: >-
            The unique code of the Gamezop game for which you want to fetch
            Leaderboards' metadata. You can find the `code` for any game from
            the [All Games API](/publishers/gamezop/guides/all-games-api)
          schema:
            type: string
          example: NkxfOJM-qg
      responses:
        '200':
          description: >-
            200 OK. If the game has no leaderboards, the data array will be
            empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaderboardsMetadataResponse'
              examples:
                Success:
                  summary: Example response with one leaderboard
                  value:
                    data:
                      - leaderboard_id: NkxfOJM-qg_default
                        name: Score leaderboard
                        description: Rankings of best scores made in Fidgety Frog
                        score_type: number
                        sorting_order: ascending
                    success: true
        '400':
          description: >-
            Bad Request. Occurs when the `game-code` parameter is not provided,
            or is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Invalid game code:
                  summary: Invalid game code
                  value:
                    message: Invalid game code.
                    success: false
        '401':
          description: >-
            Unauthorized. You get a 401 when the Bearer token is missing,
            invalid, or belongs to an archived Property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Invalid Bearer Token:
                  summary: Invalid or missing token
                  value:
                    message: Invalid or missing token.
                    success: false
components:
  schemas:
    LeaderboardsMetadataResponse:
      type: object
      properties:
        data:
          type: array
          description: >-
            Array of leaderboard metadata objects. May be empty if the game has
            no leaderboards.
          items:
            $ref: '#/components/schemas/LeaderboardMetadata'
        success:
          type: boolean
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
        success:
          type: boolean
    LeaderboardMetadata:
      type: object
      properties:
        leaderboard_id:
          type: string
          description: A unique identifier for the Leaderboard
          example: NkxfOJM-qg_default
        name:
          type: string
          description: English name of the Leaderboard (can be displayed to end-users)
        description:
          type: string
          description: >-
            A short English description of the Leaderboard (can be displayed to
            end-users)
        score_type:
          type: string
          enum:
            - number
            - percent
          description: Type of values that are captured as scores on the Leaderboard.
        sorting_order:
          type: string
          enum:
            - ascending
            - descending
          description: >-
            Captures how scores for the Leaderboard progress: ascending means
            higher score is better, descending means lower score is better.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: >-
        You can find the Bearer token for this API under Settings & Admin > API
        Tokens within the [Gamezop Business
        Dashboard](https://dashboard.gamezop.com).

````

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