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

# Polymarket Markets

> Get Polymarket Markets

Markets fetches market data from Polymarket Gamma. The AIsa route returns the upstream Gamma response directly as a top-level JSON array of market objects.

**Best for:** Discovering prediction markets, filtering by slug, condition ID, CLOB token ID, dates, volume, or closed/open state.

**Endpoint:** `GET /polymarket/markets`

## Example

```curl theme={null}
curl -X GET "https://api.aisa.one/apis/v1/polymarket/markets?limit=5&closed=false" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

## Response

The response is a JSON array. Each item is a Polymarket Gamma market object with fields such as `id`, `question`, `slug`, `conditionId`, `clobTokenIds`, `outcomes`, `outcomePrices`, `active`, `closed`, `volume`, `liquidity`, `bestBid`, and `bestAsk`.


## OpenAPI

````yaml openapi/polymarket-openapi.json GET /polymarket/markets
openapi: 3.0.3
info:
  title: AIsa API proxy
  description: APIs for prediction markets.
  version: 0.0.1
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - BearerAuth: []
paths:
  /polymarket/markets:
    get:
      summary: Get Markets
      description: >-
        Fetches Polymarket Gamma market data. This AIsa route returns the
        upstream Polymarket Gamma response directly: a top-level JSON array of
        market objects.
      operationId: get_polymarket-markets
      parameters:
        - name: limit
          in: query
          required: false
          description: Maximum number of markets to return.
          schema:
            type: integer
            minimum: 0
            example: 20
        - name: offset
          in: query
          required: false
          description: Number of markets to skip for offset-based pagination.
          schema:
            type: integer
            minimum: 0
            example: 0
        - name: order
          in: query
          required: false
          description: Comma-separated list of fields to order by.
          schema:
            type: string
            example: volume
        - name: ascending
          in: query
          required: false
          description: Sort ascending when true.
          schema:
            type: boolean
            example: false
        - name: id
          in: query
          required: false
          description: Filter by one or more Polymarket market IDs.
          schema:
            type: array
            items:
              type: integer
            example:
              - 540817
          style: form
          explode: true
        - name: slug
          in: query
          required: false
          description: Filter by one or more market slugs.
          schema:
            type: array
            items:
              type: string
            example:
              - new-rhianna-album-before-gta-vi-926
          style: form
          explode: true
        - name: clob_token_ids
          in: query
          required: false
          description: Filter by one or more CLOB token IDs.
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
        - name: condition_ids
          in: query
          required: false
          description: Filter by one or more market condition IDs.
          schema:
            type: array
            items:
              type: string
            example:
              - >-
                0x1fad72fae204143ff1c3035e99e7c0f65ea8d5cd9bd1070987bd1a3316f772be
          style: form
          explode: true
        - name: volume_num_min
          in: query
          required: false
          description: Minimum total volume.
          schema:
            type: number
            example: 1000
        - name: volume_num_max
          in: query
          required: false
          description: Maximum total volume.
          schema:
            type: number
            example: 1000000
        - name: start_date_min
          in: query
          required: false
          description: Filter markets starting after this ISO timestamp.
          schema:
            type: string
            format: date-time
            example: '2025-01-01T00:00:00Z'
        - name: start_date_max
          in: query
          required: false
          description: Filter markets starting before this ISO timestamp.
          schema:
            type: string
            format: date-time
            example: '2026-01-01T00:00:00Z'
        - name: end_date_min
          in: query
          required: false
          description: Filter markets ending after this ISO timestamp.
          schema:
            type: string
            format: date-time
            example: '2025-01-01T00:00:00Z'
        - name: end_date_max
          in: query
          required: false
          description: Filter markets ending before this ISO timestamp.
          schema:
            type: string
            format: date-time
            example: '2026-01-01T00:00:00Z'
        - name: tag_id
          in: query
          required: false
          description: Filter by tag ID.
          schema:
            type: integer
            example: 1
        - name: closed
          in: query
          required: false
          description: Filter by whether the market is closed.
          schema:
            type: boolean
            default: false
            example: false
        - name: include_tag
          in: query
          required: false
          description: Include tag metadata when true.
          schema:
            type: boolean
            example: true
      responses:
        '200':
          description: Top-level array of Polymarket market objects
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                  properties:
                    id:
                      type: string
                      example: '540817'
                    question:
                      type: string
                      example: New Rihanna Album before GTA VI?
                    slug:
                      type: string
                      example: new-rhianna-album-before-gta-vi-926
                    conditionId:
                      type: string
                      example: >-
                        0x1fad72fae204143ff1c3035e99e7c0f65ea8d5cd9bd1070987bd1a3316f772be
                    clobTokenIds:
                      description: >-
                        Polymarket CLOB token IDs. The upstream Gamma API may
                        encode this as a JSON string.
                      oneOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                    outcomes:
                      description: >-
                        Market outcomes. The upstream Gamma API may encode this
                        as a JSON string.
                      oneOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                    outcomePrices:
                      description: >-
                        Outcome prices. The upstream Gamma API may encode this
                        as a JSON string.
                      oneOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                    active:
                      type: boolean
                    closed:
                      type: boolean
                    liquidity:
                      type: string
                    volume:
                      type: string
                    volumeNum:
                      type: number
                    bestBid:
                      type: number
                    bestAsk:
                      type: number
                    startDate:
                      type: string
                      format: date-time
                    endDate:
                      type: string
                      format: date-time
                    image:
                      type: string
                    icon:
                      type: string
                    description:
                      type: string
        '400':
          description: Bad Request - Invalid parameters or validation errors
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid search parameter
                  message:
                    type: string
                    example: search must be at least 2 characters long
              examples:
                search_too_short:
                  summary: Search query too short
                  value:
                    error: Invalid search parameter
                    message: search must be at least 2 characters long
                search_with_other_params:
                  summary: Search with other parameters
                  value:
                    error: Invalid query parameters
                    message: >-
                      search parameter cannot be used with other filter
                      parameters
                invalid_limit:
                  summary: Invalid limit
                  value:
                    error: Invalid limit parameter
                    message: limit must be a number between 1 and 100
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Internal Server Error
                  message:
                    type: string
                    example: Failed to fetch markets data
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AISA API Key
      description: Your AIsa API key as a Bearer token.

````