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

# Search prediction markets by query



## OpenAPI

````yaml openapi.json get /v1/prediction-market/search
openapi: 3.0.0
info:
  title: Swaps API
  description: The Swaps API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://swap-api.flux.fun
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags: []
paths:
  /v1/prediction-market/search:
    get:
      tags:
        - Prediction Markets & Portfolio
      summary: Search prediction markets by query
      operationId: PredictionMarketsController_searchMarkets
      parameters:
        - name: query
          required: true
          in: query
          description: Search query
          schema:
            example: bitcoin
            type: string
        - name: page_size
          required: false
          in: query
          description: 'Results per page (default: 25)'
          schema:
            default: 25
            example: 25
            type: number
        - name: order_by
          required: false
          in: query
          description: 'Sort order (default: querymatch)'
          schema:
            default: querymatch
            example: trending
            type: string
        - name: fuzzy_threshold
          required: false
          in: query
          description: 'Fuzzy search threshold (default: 4)'
          schema:
            default: 4
            example: 4
            type: number
        - name: with_milestones
          required: false
          in: query
          description: 'Include milestones (default: true)'
          schema:
            default: true
            example: true
            type: boolean
        - name: cursor
          required: false
          in: query
          description: Pagination cursor
          schema:
            example: cursor123
            type: string
        - name: status
          required: false
          in: query
          description: Market status filter
          schema:
            enum:
              - open
              - unopened
              - closed
              - settled
            type: string
        - name: category
          required: false
          in: query
          description: Category filter
          schema:
            type: string
            example: Science and Technology
        - name: frequency
          required: false
          in: query
          description: Frequency filter
          schema:
            enum:
              - hourly
              - daily
              - weekly
              - monthly
              - annual
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchMarketsResponseDto'
      security:
        - api-key: []
components:
  schemas:
    SearchMarketsResponseDto:
      type: object
      properties:
        total_results_count:
          type: number
          example: 42
          description: Total number of results
        current_page:
          description: Current page of search results
          type: array
          items:
            $ref: '#/components/schemas/KalshiSearchSeriesDto'
        next_cursor:
          type: string
          nullable: true
          description: Cursor for next page
      required:
        - total_results_count
        - current_page
    KalshiSearchSeriesDto:
      type: object
      properties:
        series_ticker:
          type: string
          example: SERIES-BTC-2024
        series_title:
          type: string
          example: Bitcoin Price Series 2024
        event_ticker:
          type: string
          example: EVENT-BTC-2024
        event_subtitle:
          type: string
          example: Bitcoin price prediction event
        event_title:
          type: string
          example: Bitcoin Price Event 2024
        category:
          type: string
          example: Science and Technology
        total_series_volume:
          type: number
          example: 1000000
        total_volume:
          type: number
          example: 500000
        total_market_count:
          type: number
          example: 10
        active_market_count:
          type: number
          example: 8
        markets:
          type: array
          items:
            $ref: '#/components/schemas/KalshiSearchMarketDto'
      required:
        - series_ticker
        - series_title
        - event_ticker
        - event_subtitle
        - event_title
        - category
        - total_series_volume
        - total_volume
        - total_market_count
        - active_market_count
        - markets
    KalshiSearchMarketDto:
      type: object
      properties:
        ticker:
          type: string
          example: KXBTC-24DEC31-T100K
        yes_subtitle:
          type: string
        no_subtitle:
          type: string
        yes_bid:
          type: number
          example: 45
        yes_ask:
          type: number
          example: 47
        last_price:
          type: number
          example: 46
        yes_bid_dollars:
          type: string
          example: '0.45'
        yes_ask_dollars:
          type: string
          example: '0.47'
        last_price_dollars:
          type: string
          example: '0.46'
        price_delta:
          type: number
          example: 1.5
        close_ts:
          type: string
          example: '2024-12-31T23:59:59Z'
        expected_expiration_ts:
          type: string
          example: '2025-01-01T12:00:00Z'
        open_ts:
          type: string
          example: '2024-01-01T00:00:00Z'
        score:
          type: number
          example: 0.95
        title:
          type: string
        potential_payout_from_100_dollars:
          type: object
        icon_url_dark_mode:
          type: string
        icon_url_light_mode:
          type: string
        background_color_light_mode:
          type: string
        background_color_dark_mode:
          type: string
      required:
        - ticker
        - yes_bid
        - yes_ask
        - last_price
        - yes_bid_dollars
        - yes_ask_dollars
        - last_price_dollars
        - price_delta
        - close_ts
        - expected_expiration_ts
        - open_ts
        - score
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key

````