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

# Rank pairs by market data (JSON body)

> Same as `GET /v2/leaderboard/`, with the parameters in a JSON body instead of the query string. List parameters accept a JSON array or a comma-separated string. `type` and `filename` stay in the query string.



## OpenAPI

````yaml /openapi.yaml post /v2/leaderboard/
openapi: 3.0.3
info:
  title: Glass Market API
  version: 1.0.0
  x-logo:
    url: https://api.glassmarkets.io/static/black.png
    backgroundColor: '#FFFFFF'
    altText: Glass Market API
  description: >

    The GlassMarkets API serves the data behind the GlassMarkets app: market
    data

    collected from crypto exchanges, and market-making data for the assets your

    organizations work on. Market makers also use it to submit the metrics they

    report.


    The base URL is `https://api.glassmarkets.io`. Requests and responses are
    JSON,

    and times are ISO 8601 in UTC. `bps` means basis points: 1 bps is 0.01%.


    ## Authentication


    1. Log in with `POST /v1/login/`, sending your email and password. The
    response
       contains a `token` and its `expiry`.
    2. Send the token on every request in the `Authorization` header:
       `Authorization: Token <token>`.

    A token expires one day after its last use, and at most 30 days after login.

    With `"remember_me": true` at login, it stays valid for at least 7 days. A

    request with a missing, expired or revoked token returns `401`: log in
    again.

    `POST /v1/logout/` revokes the token.


    If your account has two-factor authentication, login returns `202` with a

    `challenge_id`. Send it with your authentication code to `POST
    /v1/totp/login/`

    to get the token.


    ## Quickstart


    1. Log in:

       ```
       curl -X POST https://api.glassmarkets.io/v1/login/ \
         -H "Content-Type: application/json" \
         -d '{"email": "you@example.com", "password": "..."}'
       ```

    2. List your organizations with `GET /v1/organizations/`. Each organization
       lists its assets. Each asset lists the exchanges it trades on (`slug`) and
       the pairs on each exchange. Use these exact values in other requests.

       ```
       curl https://api.glassmarkets.io/v1/organizations/ \
         -H "Authorization: Token <token>"
       ```

    3. Call an endpoint with those values, for example the daily trading volume
    of
       one of your assets:

       ```
       curl -G https://api.glassmarkets.io/v2/metrics/volume/ \
         -H "Authorization: Token <token>" \
         -d assets=BTC -d interval=1d \
         -d time_start=2026-09-01T00:00:00Z -d time_end=2026-09-08T00:00:00Z
       ```

    ## Errors


    Invalid input returns `400` with the problem per field, for example

    `{"interval": ["This field is required."]}`. Other errors return a status

    code with a `detail` message: `401` when you are not logged in, `403` when
    your

    account may not use the endpoint, and `404` when the resource does not
    exist.
servers:
  - url: https://api.glassmarkets.io
security: []
tags:
  - name: Authentication
    description: Log in, log out and read the current session.
  - name: Organizations
    description: Your organizations, and the assets, exchanges and pairs each one covers.
  - name: Reported metrics
    description: Volume, depth and spread that market makers report for their assets.
  - name: Trusted metrics
    description: >-
      Volume, depth and spread that Shield measures directly from market makers'
      exchange accounts.
  - name: Market maker metrics
    description: >-
      Market-maker volume, depth, spread, uptime and coverage, combining trusted
      and reported data.
  - name: Targets
    description: >-
      Market-making targets per asset, exchange and pair, and whether they are
      met.
  - name: Market data
    description: >-
      Exchange market data for your assets: volume, spread, order book depth,
      slippage, uptime, futures and more.
  - name: Leaderboard
    description: Trading pairs across exchanges, ranked by market data.
  - name: Loans
    description: Token loans to market makers for your assets.
  - name: RFQ
    description: >-
      Requests for quotes: a project invites market makers to propose
      market-making terms for its token.
  - name: Account
    description: Manage your password, passkeys and two-factor authentication.
paths:
  /v2/leaderboard/:
    post:
      tags:
        - Leaderboard
      summary: Rank pairs by market data (JSON body)
      description: >-
        Same as `GET /v2/leaderboard/`, with the parameters in a JSON body
        instead of the query string. List parameters accept a JSON array or a
        comma-separated string. `type` and `filename` stay in the query string.
      operationId: v2_leaderboard_post
      parameters:
        - in: query
          name: filename
          schema:
            type: string
          description: File name of the CSV download. Defaults to `data.csv`.
        - in: query
          name: type
          schema:
            type: string
            enum:
              - csv
          description: '`csv` returns a CSV file instead of JSON.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricsLeaderboardParameter'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MetricsLeaderboardParameter'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MetricsLeaderboardParameter'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricsLeaderboardResponse'
            text/csv:
              schema:
                type: string
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    MetricsLeaderboardParameter:
      type: object
      properties:
        assets:
          type: array
          items:
            type: string
          description: >-
            Comma separated list of assets. Defaults to all authorized assets.
            Regular users may request at most 100 assets and, when omitted,
            receive the first 100 authorized assets ordered by symbol; staff are
            unlimited.
        time_start:
          type: string
          format: date-time
          description: Window start, ISO 8601. UTC when no offset is given.
        time_end:
          type: string
          format: date-time
          description: Window end, ISO 8601. UTC when no offset is given.
        lookback:
          allOf:
            - $ref: '#/components/schemas/LookbackEnum'
          description: >-
            Relative window ending now. Can't be combined with
            `time_start`/`time_end`.


            * `30-minutes` - 30-minutes

            * `1-hour` - 1-hour

            * `3-hours` - 3-hours

            * `6-hours` - 6-hours

            * `12-hours` - 12-hours

            * `1-day` - 1-day

            * `7-days` - 7-days

            * `1-month` - 1-month

            * `3-months` - 3-months

            * `6-months` - 6-months

            * `1-year` - 1-year
        interval:
          $ref: '#/components/schemas/IntervalA05Enum'
        market_hours_preset:
          allOf:
            - $ref: '#/components/schemas/MarketHoursPresetEnum'
          description: >-
            Trading session to restrict the window to. Requires
            `market_hours_days`; can't be combined with `time_start`/`time_end`
            or `lookback`.


            * `pre-market` - pre-market

            * `opening-bell` - opening-bell

            * `market-hours` - market-hours

            * `closing-bell` - closing-bell

            * `after-hours` - after-hours

            * `blue-ocean` - blue-ocean

            * `weekend-hours` - weekend-hours
        market_hours_days:
          type: string
          description: >-
            Days to include, as comma-separated `week:day` pairs such as
            `this:1,last:5`, or a JSON array of `{"week", "day"}` objects.
            `week` is `this` or `last`; `day` is 0 (Sunday) to 6 (Saturday).
        market_hours_timezone:
          type: string
          default: America/New_York
          description: Time zone of the market-hours sessions.
        exchanges:
          type: array
          items:
            type: string
          description: >-
            Comma-separated exchange slugs, e.g. `binance,okx`. Defaults to all
            exchanges.
          maxItems: 100
        types:
          $ref: '#/components/schemas/TypesEnum'
        page:
          type: integer
          minimum: 1
          default: 1
          description: Page number; each page has 20 rows.
        bps:
          type: array
          items:
            type: number
            format: double
          default:
            - 200
          description: Depth levels to return, in basis points.
          maxItems: 25
        sort_by:
          type: string
          default: volume
          description: >-
            Column to sort by: `volume`, `price_change`, `usd_open_interest`,
            `funding_rate_8h`, `tick_bps`, or a depth column such as `bid_2bps`.
          pattern: >-
            ^(volume|price_change|usd_open_interest|funding_rate_8h|tick_bps|bid_[0-9]+(?:\.[0-9]+)?bps|ask_[0-9]+(?:\.[0-9]+)?bps)$
        sort_direction:
          allOf:
            - $ref: '#/components/schemas/SortDirectionEnum'
          default: desc
    MetricsLeaderboardResponse:
      type: object
      properties:
        asset:
          type: string
        exchange:
          $ref: '#/components/schemas/ExchangeResponse'
        pair:
          type: string
        price_change:
          type: number
          format: double
          nullable: true
        volume:
          type: number
          format: double
        usd_open_interest:
          type: number
          format: double
        funding_rate_8h:
          type: number
          format: double
        tick_bps:
          type: number
          format: double
          nullable: true
        tick_bps_status:
          type: string
          nullable: true
        tick_bps_samples:
          type: number
          format: double
          nullable: true
        bid_0bps:
          type: number
          format: double
          nullable: true
        bid_0.05bps:
          type: number
          format: double
          nullable: true
        bid_0.1bps:
          type: number
          format: double
          nullable: true
        bid_0.15bps:
          type: number
          format: double
          nullable: true
        bid_0.25bps:
          type: number
          format: double
          nullable: true
        bid_0.5bps:
          type: number
          format: double
          nullable: true
        bid_0.75bps:
          type: number
          format: double
          nullable: true
        bid_1bps:
          type: number
          format: double
          nullable: true
        bid_2bps:
          type: number
          format: double
          nullable: true
        bid_3bps:
          type: number
          format: double
          nullable: true
        bid_5bps:
          type: number
          format: double
          nullable: true
        bid_10bps:
          type: number
          format: double
          nullable: true
        bid_15bps:
          type: number
          format: double
          nullable: true
        bid_20bps:
          type: number
          format: double
          nullable: true
        bid_25bps:
          type: number
          format: double
          nullable: true
        bid_30bps:
          type: number
          format: double
          nullable: true
        bid_40bps:
          type: number
          format: double
          nullable: true
        bid_50bps:
          type: number
          format: double
          nullable: true
        bid_60bps:
          type: number
          format: double
          nullable: true
        bid_75bps:
          type: number
          format: double
          nullable: true
        bid_100bps:
          type: number
          format: double
          nullable: true
        bid_150bps:
          type: number
          format: double
          nullable: true
        bid_200bps:
          type: number
          format: double
          nullable: true
        bid_300bps:
          type: number
          format: double
          nullable: true
        bid_500bps:
          type: number
          format: double
          nullable: true
        ask_0bps:
          type: number
          format: double
          nullable: true
        ask_0.05bps:
          type: number
          format: double
          nullable: true
        ask_0.1bps:
          type: number
          format: double
          nullable: true
        ask_0.15bps:
          type: number
          format: double
          nullable: true
        ask_0.25bps:
          type: number
          format: double
          nullable: true
        ask_0.5bps:
          type: number
          format: double
          nullable: true
        ask_0.75bps:
          type: number
          format: double
          nullable: true
        ask_1bps:
          type: number
          format: double
          nullable: true
        ask_2bps:
          type: number
          format: double
          nullable: true
        ask_3bps:
          type: number
          format: double
          nullable: true
        ask_5bps:
          type: number
          format: double
          nullable: true
        ask_10bps:
          type: number
          format: double
          nullable: true
        ask_15bps:
          type: number
          format: double
          nullable: true
        ask_20bps:
          type: number
          format: double
          nullable: true
        ask_25bps:
          type: number
          format: double
          nullable: true
        ask_30bps:
          type: number
          format: double
          nullable: true
        ask_40bps:
          type: number
          format: double
          nullable: true
        ask_50bps:
          type: number
          format: double
          nullable: true
        ask_60bps:
          type: number
          format: double
          nullable: true
        ask_75bps:
          type: number
          format: double
          nullable: true
        ask_100bps:
          type: number
          format: double
          nullable: true
        ask_150bps:
          type: number
          format: double
          nullable: true
        ask_200bps:
          type: number
          format: double
          nullable: true
        ask_300bps:
          type: number
          format: double
          nullable: true
        ask_500bps:
          type: number
          format: double
          nullable: true
      required:
        - asset
        - exchange
        - pair
        - price_change
        - volume
    LookbackEnum:
      enum:
        - 30-minutes
        - 1-hour
        - 3-hours
        - 6-hours
        - 12-hours
        - 1-day
        - 7-days
        - 1-month
        - 3-months
        - 6-months
        - 1-year
      type: string
      description: |-
        * `30-minutes` - 30-minutes
        * `1-hour` - 1-hour
        * `3-hours` - 3-hours
        * `6-hours` - 6-hours
        * `12-hours` - 12-hours
        * `1-day` - 1-day
        * `7-days` - 7-days
        * `1-month` - 1-month
        * `3-months` - 3-months
        * `6-months` - 6-months
        * `1-year` - 1-year
    IntervalA05Enum:
      enum:
        - 1M
        - 1w
        - 1d
        - 4h
        - 1h
        - 30m
        - 15m
        - 5m
        - 1m
        - c
        - a
      type: string
      description: >-
        * `1M` - Aggregated in 1 month periods.

        * `1w` - Aggregated in 1 week periods.

        * `1d` - Aggregated in 1 day periods.

        * `4h` - Aggregated in 4 hour periods.

        * `1h` - Aggregated in 1 hour periods.

        * `30m` - Aggregated in 30 minute periods.

        * `15m` - Aggregated in 15 minute periods.

        * `5m` - Aggregated in 5 minute periods.

        * `1m` - Aggregated in 1 minute periods.

        * `c` - Will return all the data for the specified time range using the
        biggest periods possible.

        * `a` - Will return the aggregate of the data for the specified time
        range.
    MarketHoursPresetEnum:
      enum:
        - pre-market
        - opening-bell
        - market-hours
        - closing-bell
        - after-hours
        - blue-ocean
        - weekend-hours
      type: string
      description: |-
        * `pre-market` - pre-market
        * `opening-bell` - opening-bell
        * `market-hours` - market-hours
        * `closing-bell` - closing-bell
        * `after-hours` - after-hours
        * `blue-ocean` - blue-ocean
        * `weekend-hours` - weekend-hours
    TypesEnum:
      enum:
        - all
        - spot
        - perp
      type: string
      description: |-
        * `all` - Spot and Perp
        * `spot` - Spot
        * `perp` - Perp
    SortDirectionEnum:
      enum:
        - asc
        - desc
      type: string
      description: |-
        * `asc` - Ascending
        * `desc` - Descending
    ExchangeResponse:
      type: object
      properties:
        slug:
          type: string
        name:
          type: string
        icon_url:
          type: string
          format: uri
      required:
        - icon_url
        - name
        - slug
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Token-based authentication with required prefix "Token ". Example:
        "Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
      x-default: Token <token>

````