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

# Aggregate event counters (sidebar tiles)

> Event counters: `total` (still-current events with at least one visible PRE_MARKET, OPEN, PAUSED or POSTPONED market, or POSTPONED themselves, sibling long-crypto periods counted once — not the length of a full `GET /api/events` walk, which also carries in-play fixtures whose markets have all closed), `matches` + `tournament` (a partition of `total`), `groupStage` / `knockoutStage` (stage subsets from the parent match) and `live` (reserved, currently always 0). No parameters. Cached server-side for 3 minutes and sent with `Cache-Control: public, max-age=60`, so values can be a few minutes old.



## OpenAPI

````yaml /api-reference/openapi.json get /api/events/stats
openapi: 3.1.0
info:
  title: PredictStreet API
  description: >-
    Client-facing HTTP API for the PredictStreet prediction-market platform.
    **Partner kinds.** Every authenticated endpoint resolves a request's
    *effective wallet* from the partner row. `single_wallet` partners bind to
    one `associatedWallet` set at creation. `multi_wallet` partners declare the
    actor on every request via an `X-User-Wallet: 0x<40-hex>` header. See the
    [Partner kinds](/auth/api-keys#partner-kinds) doc for the full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core.api.dev.predictstreet.sde.adifoundation.ai
    description: Testnet (partner integrator API — final domain TBD)
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Crypto
    description: >-
      Crypto price markets: the underlying-asset price curve and Up/Down series
      navigation. The markets themselves are ordinary binary markets — list them
      through /api/markets and /api/events.
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      A match groups several events into one fixture/card (1X2 + first-scorer +
      over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the web app (user sessions) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
  - name: Platform
    description: >-
      Public platform state: the contract registry, the platform fee
      configuration, the platform freeze flag and active notices. No
      authentication.
paths:
  /api/events/stats:
    get:
      tags:
        - Events
      summary: Aggregate event counters (sidebar tiles)
      description: >-
        Event counters: `total` (still-current events with at least one visible
        PRE_MARKET, OPEN, PAUSED or POSTPONED market, or POSTPONED themselves,
        sibling long-crypto periods counted once — not the length of a full `GET
        /api/events` walk, which also carries in-play fixtures whose markets
        have all closed), `matches` + `tournament` (a partition of `total`),
        `groupStage` / `knockoutStage` (stage subsets from the parent match) and
        `live` (reserved, currently always 0). No parameters. Cached server-side
        for 3 minutes and sent with `Cache-Control: public, max-age=60`, so
        values can be a few minutes old.
      operationId: EventsController_stats
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventStatsRespDto'
              examples:
                stats:
                  summary: Counters
                  value:
                    total: 1858
                    knockoutStage: 0
                    groupStage: 0
                    matches: 101
                    tournament: 1757
                    live: 0
      security:
        - {}
components:
  schemas:
    EventStatsRespDto:
      type: object
      properties:
        total:
          type: integer
          description: >-
            Events on the default open view with at least one visible
            PRE_MARKET, OPEN, PAUSED or POSTPONED market (or a POSTPONED event);
            sibling long-crypto periods count once. Not the length of a full
            `GET /api/events` walk: the list also carries in-play fixtures whose
            markets have all closed, and these counters can be a few minutes
            old.
          example: 1858
        knockoutStage:
          type: integer
          description: >-
            Subset of `total` whose parent match is in a knockout round (`r32`,
            `r16`, `quarter_finals`, `semi_finals`, `third_place`, `final`).
          example: 0
        live:
          type: integer
          description: >-
            Reserved; currently always 0. For in-play events use `GET
            /api/events?sort=live`.
          example: 0
        matches:
          type: integer
          description: Events bound to a match. `matches + tournament = total`.
          example: 101
        tournament:
          type: integer
          description: >-
            Events with no parent match (outrights and match-less fixtures).
            `matches + tournament = total`.
          example: 1757
        groupStage:
          type: integer
          description: Subset of `total` whose parent match is in the group stage.
          example: 0
      required:
        - total
        - knockoutStage
        - live
        - matches
        - tournament
        - groupStage
      description: >-
        Event counters. `matches` and `tournament` partition `total`;
        `groupStage` and `knockoutStage` are stage subsets of it.

````

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