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

# Search Markets

> Returns markets matching the query string. Can filter by a supported venue.



## OpenAPI

````yaml /openapi/v1.json get /v1/markets/search
openapi: 3.0.0
info:
  title: ParlayX API
  version: 1.0.0
  description: Aggregated prediction-market trading API
servers:
  - url: https://api.parlayx.com
security:
  - apiKey: []
tags:
  - name: Markets
    description: Discover markets and find cross-venue matches.
  - name: Orders
    description: Submit, inspect, and cancel orders.
  - name: Rebalances
    description: Move funds between venues and track the transfer.
  - name: Balance
    description: Read account balances and funding state.
paths:
  /v1/markets/search:
    get:
      tags:
        - Markets
      summary: Search Markets
      description: >-
        Returns markets matching the query string. Can filter by a supported
        venue.
      operationId: searchMarkets
      parameters:
        - schema:
            type: string
            minLength: 3
            description: >-
              Free-text search query matched against market titles across
              supported venues. Minimum 3 characters.
            example: Lakers NBA Finals
          required: true
          name: q
          in: query
        - schema:
            type: array
            items:
              $ref: '#/components/schemas/Venue'
            default:
              - polymarket
              - limitless
            description: >-
              Filter to specific venues (comma-separated). Defaults to all
              supported.
            example:
              - polymarket
              - limitless
          required: false
          name: venues
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            description: Max results to return (1-100)
            example: 20
          required: false
          name: limit
          in: query
      responses:
        '200':
          description: Matching markets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchMarketsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: API key missing, malformed, or not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              example:
                message: Forbidden
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >
            import { createClient } from "@parlayx/sdk";


            const client = createClient({ apiKey: process.env.PARLAYX_API_KEY!
            });


            const { markets } = await client.searchMarkets({
              q: "election",
              venues: ["polymarket"],
              limit: 10,
            });


            for (const market of markets) {
              console.log(market.venue, market.marketId, market.title);
            }
components:
  schemas:
    Venue:
      type: string
      enum:
        - polymarket
        - limitless
        - predict_fun
      description: Source market venue (must be a supported venue)
      example: polymarket
    SearchMarketsResponse:
      type: object
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/MarketSummary'
      required:
        - markets
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/ApiErrorCode'
            message:
              type: string
              description: Plain-text explanation of the error.
          required:
            - code
            - message
      required:
        - error
    AuthError:
      type: object
      properties:
        message:
          type: string
          description: Plain-text explanation of the authentication error.
      required:
        - message
    MarketSummary:
      type: object
      properties:
        venue:
          $ref: '#/components/schemas/Venue'
        title:
          type: string
          example: Will the Lakers win the 2026 NBA Finals?
        status:
          $ref: '#/components/schemas/MarketStatus'
        marketId:
          type: string
          description: >-
            Venue-native market identifier (Polymarket: `condition_id`;
            Limitless: `slug`).
      required:
        - venue
        - title
        - status
        - marketId
    ApiErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - NOT_FOUND
        - INSUFFICIENT_BALANCE
        - IDEMPOTENCY_CONFLICT
        - ORDER_NOT_CANCELLABLE
        - INTERNAL_ERROR
      description: Stable identifier for the error category.
    MarketStatus:
      type: string
      enum:
        - open
        - closed
      example: open
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````