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

# Search events or markets

> Hybrid search (trigram + FTS + vector) across events or markets. Returns results ranked by relevance. Use listing endpoints for filtered discovery. The embedded `venueMarkets` on each event result are a top-N preview only; for the full market list use GET /venue-markets?venueEventId=.



## OpenAPI

````yaml /openapi/openapi.json get /search
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
  - url: https://api.staging.agg.market
    description: Staging
security: []
paths:
  /search:
    get:
      tags:
        - Search
      summary: Search events or markets
      description: >-
        Hybrid search (trigram + FTS + vector) across events or markets. Returns
        results ranked by relevance. Use listing endpoints for filtered
        discovery. The embedded `venueMarkets` on each event result are a top-N
        preview only; for the full market list use GET
        /venue-markets?venueEventId=.
      operationId: search
      parameters:
        - name: q
          in: query
          required: true
          schema:
            minLength: 1
            type: string
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - events
              - markets
        - name: categoryIds
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: string
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                  enum:
                    - open
                    - closed
                    - resolved
                    - unopened
                    - paused
              - type: string
                enum:
                  - open
                  - closed
                  - resolved
                  - unopened
                  - paused
        - name: limit
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: number
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: deepSearch
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    required:
                      - type
                      - data
                      - nextCursor
                      - hasMore
                    properties:
                      type:
                        type: string
                        enum:
                          - events
                      data:
                        type: array
                        items: {}
                      nextCursor:
                        type: string
                        nullable: true
                      hasMore:
                        type: boolean
                  - type: object
                    required:
                      - type
                      - data
                      - nextCursor
                      - hasMore
                    properties:
                      type:
                        type: string
                        enum:
                          - markets
                      data:
                        type: array
                        items: {}
                      nextCursor:
                        type: string
                        nullable: true
                      hasMore:
                        type: boolean
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
      security:
        - appId: []
components:
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.

````