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

# Search markets

> Indexed relevance-ranked search across both exchanges. Default sort is relevance (exact id/ticker/slug, prefix, all-token substring, fuzzy n-gram, then 24h volume). Cursor is an opaque keyset token (breaking change vs numeric offsets).



## OpenAPI

````yaml /prediction-markets/openapi.json get /v1/markets/search
openapi: 3.1.0
info:
  title: Prediction Market API (Beta)
  description: >-
    Unified **beta** prediction market API for Kalshi and Polymarket — markets,
    events, full historical trades and candlesticks, orderbooks, crypto up/down
    windows, and Polymarket wallet analytics. Read/market-data only.


    **Auth:** pass your Data API key in the `x-api-key` header.


    **Conventions:** response bodies use camelCase. Query params are snake_case
    (camelCase aliases accepted where noted).


    **Caching:** SWR endpoints may set `X-Cache` (`HIT` | `HIT-STALE` | `MISS`).
    Busy backends may return `503` with `SERVICE_BUSY`.


    **Realtime:** join `pm:*` rooms on
    `wss://datastream.solanatracker.io/{apiKey}` (same Datastream hub as other
    products — see Datastream → Prediction Markets).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://prediction-market-api.solanatracker.io
    description: Public beta
security:
  - apiKey: []
tags:
  - name: Exchange
    description: Exchange status
  - name: Events
    description: >-
      Cross-exchange event groupings (Kalshi event_ticker, Polymarket Gamma
      grouped/negRisk events). Includes metadata: image, icon, description,
      tags, and nested markets with groupItemTitle.
  - name: Crypto
    description: >-
      Polymarket crypto up/down (Chainlink) Price to Beat, final price, chart
      history, and series windows.
  - name: Meta
    description: Categories, series, sports, live data
  - name: Markets
    description: Market data, orderbooks, candles
  - name: Trades
    description: Trade feeds
  - name: Accounts
    description: Polymarket wallet analytics (FIFO PnL)
  - name: Leaderboard
    description: Top wallet PnL rankings (Polymarket; Kalshi has no public wallets)
  - name: Stats
    description: Platform statistics
paths:
  /v1/markets/search:
    get:
      tags:
        - Markets
      summary: Search markets
      description: >-
        Indexed relevance-ranked search across both exchanges. Default sort is
        relevance (exact id/ticker/slug, prefix, all-token substring, fuzzy
        n-gram, then 24h volume). Cursor is an opaque keyset token (breaking
        change vs numeric offsets).
      operationId: search_markets_path
      parameters:
        - name: q
          in: query
          description: Required search query (min 2 characters)
          required: false
          schema:
            type: string
        - name: exchange
          in: query
          description: kalshi, polymarket, or poly
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: active, closed, or all (default active)
          required: false
          schema:
            type: string
        - name: category
          in: query
          description: Category filter
          required: false
          schema:
            type: string
        - name: min_volume
          in: query
          description: Minimum volume USD
          required: false
          schema:
            type: number
            format: double
        - name: max_volume
          in: query
          description: Maximum volume USD
          required: false
          schema:
            type: number
            format: double
        - name: sort
          in: query
          description: >-
            relevance (default), volume, volume24h, liquidity, openInterest,
            createdAt
          required: false
          schema:
            type: string
        - name: order
          in: query
          description: asc or desc (ignored for relevance)
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Max results (default 20, max 50)
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: cursor
          in: query
          description: Opaque keyset cursor from a previous response (not a numeric offset)
          required: false
          schema:
            type: string
        - name: includeCombos
          in: query
          description: Include Kalshi combo/multivariate markets (default false)
          required: false
          schema:
            type: boolean
        - name: marketKind
          in: query
          description: 'Product filter: binary, categorical, or combo (comma-separated)'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMarkets'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '408':
          description: Request timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
components:
  schemas:
    PaginatedMarkets:
      type: object
      required:
        - data
        - count
        - hasMore
      properties:
        count:
          type: integer
          minimum: 0
        cursor:
          type:
            - string
            - 'null'
        data:
          type: array
          items:
            $ref: '#/components/schemas/UnifiedMarket'
        hasMore:
          type: boolean
    ApiErrorBody:
      type: object
      description: Standard API error response envelope.
      required:
        - error
        - code
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code (duplicated for convenience).
          minimum: 0
        error:
          type: string
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code: RATE_LIMITED, SERVICE_BUSY,
            BAD_REQUEST, NOT_FOUND, INTERNAL.
    UnifiedMarket:
      type: object
      description: >-
        A single market in normalized form.


        Polymarket markets in grouped events include `eventId`, `eventSlug`,
        `groupItemTitle`,

        `description`, `image`, and `icon`. Kalshi markets include `eventTicker`
        and optional `kalshi` metadata.
      required:
        - id
        - exchange
        - marketKind
        - title
        - slug
        - status
        - outcomes
        - volume
        - pricingMode
        - isTradable
        - hasDepth
      properties:
        category:
          type:
            - string
            - 'null'
          description: Category/tag for this market.
        clobTokenIds:
          type: array
          items:
            type: string
          description: |-
            Polymarket CLOB outcome token IDs, ordered to match `outcomes`.
            Use these IDs for `pm:market:polymarket:{tokenId}:*` realtime rooms.
        closeDate:
          type:
            - string
            - 'null'
          description: ISO-8601 market close / expiry time.
        collectionId:
          type:
            - string
            - 'null'
          description: Official multivariate/collection id when present.
        comboEligible:
          type: boolean
          description: Whether this market can be selected as one leg in a combo builder.
        comboGroup:
          type:
            - string
            - 'null'
          description: UI grouping key for combo builders.
        createdAt:
          type:
            - string
            - 'null'
          description: ISO-8601 creation time.
        description:
          type:
            - string
            - 'null'
          description: Long-form market description (Polymarket Gamma).
        eventId:
          type:
            - string
            - 'null'
          description: Polymarket Gamma event id (numeric string, e.g. "30615").
        eventSlug:
          type:
            - string
            - 'null'
          description: Polymarket event slug (e.g. "world-cup-winner").
        eventTicker:
          type:
            - string
            - 'null'
          description: Kalshi event_ticker for grouping related markets.
        eventTitle:
          type:
            - string
            - 'null'
          description: >-
            Canonical parent event title (distinct from the child market/group
            title).
        exchange:
          $ref: '#/components/schemas/Exchange'
          description: Source exchange.
        gammaMarketId:
          type:
            - string
            - 'null'
          description: Polymarket Gamma numeric market id (distinct from condition_id).
        groupItemTitle:
          type:
            - string
            - 'null'
          description: Label within a grouped Polymarket event (e.g. "France").
        hasDepth:
          type: boolean
          description: Whether the indexed orderbook currently has executable depth.
        icon:
          type:
            - string
            - 'null'
          description: Market icon URL (Polymarket Gamma).
        id:
          type: string
          description: >-
            Unique identifier within its exchange (ticker for Kalshi,
            condition_id for Polymarket).
        image:
          type:
            - string
            - 'null'
          description: Market image URL (Polymarket Gamma).
        isTradable:
          type: boolean
          description: Whether the market can currently accept orders or RFQs.
        legCount:
          type: integer
          description: Number of component markets in a combo.
          minimum: 0
        legs:
          type: array
          items:
            $ref: '#/components/schemas/MarketLeg'
          description: Structured combo legs. Empty for ordinary markets.
        line:
          type:
            - number
            - 'null'
          format: double
          description: Numeric spread/total threshold where applicable.
        liquidity:
          type:
            - number
            - 'null'
          format: double
          description: Available liquidity (Polymarket only).
        marketKind:
          $ref: '#/components/schemas/MarketKind'
          description: Product shape. Kalshi multivariate/parlay products are `combo`.
        materializationState:
          type:
            - string
            - 'null'
          description: Materialization state for prebuilt/multivariate contracts.
        openInterest:
          type:
            - integer
            - 'null'
          format: int64
          description: Open interest in contracts (Kalshi only).
          minimum: 0
        outcomeIndex:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Selected outcome index when this market was resolved by
            outcome-token asset ID.
          minimum: 0
        outcomeLabel:
          type:
            - string
            - 'null'
          description: >-
            Selected outcome label when this market was resolved by
            outcome-token asset ID.
        outcomes:
          type: array
          items:
            $ref: '#/components/schemas/UnifiedOutcome'
          description: Possible outcomes with current prices (0.0–1.0 probability).
        parentEventUrl:
          type:
            - string
            - 'null'
          description: Parent multivariate event URL for combo products.
        pricingMode:
          $ref: '#/components/schemas/PricingMode'
          description: Price discovery mechanism.
        rawTitle:
          type:
            - string
            - 'null'
          description: >-
            Original exchange title when the API supplies a normalized display
            title.
        seriesTicker:
          type:
            - string
            - 'null'
          description: Machine series ticker supplied by Kalshi.
        seriesTitle:
          type:
            - string
            - 'null'
          description: Canonical series title when supplied by the exchange.
        settlementRule:
          type:
            - string
            - 'null'
          description: Settlement semantics for combo products.
        slug:
          type: string
          description: 'URL-safe slug (Kalshi: lowercase ticker, Polymarket: slug field).'
        sportsMarketType:
          type:
            - string
            - 'null'
          description: >-
            Exchange-native sports market type (moneyline, totals, spread,
            etc.).
        status:
          type: string
          description: 'Market status: "active", "closed", "settled".'
        tags:
          type: array
          items:
            type: string
          description: Normalized discovery tags.
        ticker:
          type:
            - string
            - 'null'
          description: Raw Kalshi ticker. `id` remains the cross-exchange identifier.
        title:
          type: string
          description: Human-readable title/question.
        tradeCount24h:
          type:
            - integer
            - 'null'
          format: int64
          description: Rolling 24-hour trade count from the indexed tape (when available).
          minimum: 0
        url:
          type:
            - string
            - 'null'
          description: Direct link to the market on its native platform.
        volume:
          type: number
          format: double
          description: Total all-time volume (USD).
        volume24h:
          type:
            - number
            - 'null'
          format: double
          description: Rolling 24-hour volume (USD, if available).
    Exchange:
      type: string
      enum:
        - polymarket
        - kalshi
    MarketLeg:
      type: object
      required:
        - label
        - side
      properties:
        eventDate:
          type:
            - string
            - 'null'
        exclusionGroup:
          type:
            - string
            - 'null'
          description: Exclusion/conflict group for mutually exclusive legs.
        label:
          type: string
        lifecycleStatus:
          type:
            - string
            - 'null'
          description: 'Per-leg lifecycle: open, suspended, settled, void.'
        officialLegId:
          type:
            - string
            - 'null'
          description: Official exchange leg/position identifier when available.
        positionId:
          type:
            - string
            - 'null'
          description: Exchange-native position/outcome id for this leg.
        side:
          $ref: '#/components/schemas/MarketLegSide'
        sport:
          type:
            - string
            - 'null'
        underlyingMarketId:
          type:
            - string
            - 'null'
        underlyingTitle:
          type:
            - string
            - 'null'
    MarketKind:
      type: string
      enum:
        - binary
        - categorical
        - combo
    UnifiedOutcome:
      type: object
      description: A single binary or multi-category outcome with a price.
      required:
        - label
        - price
      properties:
        label:
          type: string
          description: >-
            Outcome label (Yes/No, or custom e.g. country name in grouped
            markets).
        price:
          type: number
          format: double
          description: Current probability (0.0–1.0).
    PricingMode:
      type: string
      enum:
        - orderbook
        - rfq
    MarketLegSide:
      type: string
      enum:
        - 'yes'
        - 'no'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Solana Tracker Data API key

````