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

# List Markets

> Search markets via Polymarket public-search by keyword, status, sorting and pagination.

Search for markets on Polymarket using keywords and various filters.

## Overview

Use this endpoint for discovery before context checks and execution.

## Query parameters

| Parameter      | Type    | Required | Default      | Description                    |
| -------------- | ------- | -------- | ------------ | ------------------------------ |
| `q`            | string  | Yes      | -            | Search keywords                |
| `limit`        | integer | No       | `20`         | Results per page               |
| `page`         | integer | No       | `1`          | 1-indexed page number          |
| `order`        | string  | No       | -            | Sorting field                  |
| `ascending`    | boolean | No       | `false`      | Sort direction                 |
| `eventsStatus` | string  | No       | `active`     | `active`, `resolved`, `closed` |
| `closed`       | boolean | No       | `false`      | Closed market filter           |
| `venue`        | string  | No       | `polymarket` | Venue selector                 |

## Examples

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl -X GET "https://www.aionmarket.com/bvapi/markets?q=election&limit=20&order=volume24hr&ascending=false" \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Tab>

  <Tab title="Python SDK">
    ```python theme={null}
    from aion_sdk import AionMarketClient

    client = AionMarketClient(api_key="YOUR_API_KEY", base_url="https://www.aionmarket.com/bvapi")

    markets = client.get_markets(
        q="election",
        limit=20,
        page=1,
        venue="polymarket",
        events_status="active",
    )
    print(markets)
    ```
  </Tab>
</Tabs>

## Response

```json theme={null}
[
  {
    "id": "0x123abc...",
    "title": "Will Biden win the 2024 election?",
    "question": "Will Joe Biden win the 2024 US Presidential election?",
    "conditionId": "0xabc123...",
    "category": "Politics",
    "endDate": "2024-11-05T00:00:00Z",
    "createdAt": "2024-01-01T00:00:00Z",
    "lastUpdatedAt": "2024-04-15T10:30:00Z",
    "volume24hr": "1500000",
    "liquidity": "500000",
    "bestBid": "0.65",
    "bestAsk": "0.68",
    "active": true,
    "resolved": false,
    "outcomes": ["Yes", "No"]
  }
]
```

## Search Tips

* **By Category**: Search for category names like "Politics", "Sports", "Crypto"
* **By Question**: Search for specific questions about events
* **By Keyword**: Use broader terms to find related markets
* **Sort by Volume**: Discover most active markets with `order=volume24hr`
* **Active Only**: Use `eventsStatus=active` to find ongoing trading opportunities

## Response Fields

| Field         | Type    | Description          |
| ------------- | ------- | -------------------- |
| `id`          | string  | Market identifier    |
| `title`       | string  | Market title         |
| `question`    | string  | Full market question |
| `conditionId` | string  | Condition ID         |
| `category`    | string  | Market category      |
| `endDate`     | string  | Resolution time      |
| `volume24hr`  | string  | 24h volume           |
| `liquidity`   | string  | Liquidity            |
| `bestBid`     | string  | Best bid             |
| `bestAsk`     | string  | Best ask             |
| `active`      | boolean | Active flag          |
| `resolved`    | boolean | Resolved flag        |
| `outcomes`    | array   | Outcome names        |

## Common errors

| Code  | Meaning                    |
| ----- | -------------------------- |
| `400` | Invalid query parameters   |
| `401` | Invalid or missing API key |
| `429` | Rate limited               |

## Use Cases

* **Market Discovery**: Find relevant markets for your trading strategy
* **Opportunity Scanning**: Identify high-volume or liquid markets
* **Category Filtering**: Browse markets within specific domains
* **Heartbeat Data**: Include in periodic market refreshes


## OpenAPI

````yaml GET /markets
openapi: 3.1.0
info:
  title: Aion AI Agent API
  description: >-
    API for agent registration, wallet onboarding, market discovery, order
    management, and execution on Aion.
  version: 1.0.0
  contact:
    name: Aion Support
    email: info@aionmarket.com
    url: https://docs.aionmarket.com
servers:
  - url: https://www.aionmarket.com/bvapi
    description: Aion API
security:
  - bearerAuth: []
tags:
  - name: Agent Management
  - name: Market Operations
  - name: Order Management
  - name: Trading
  - name: Kalshi
  - name: Skills
  - name: Wallet Management
  - name: Trades & Leaderboard
  - name: Utilities
  - name: Settings
  - name: Positions & Portfolio
  - name: Fee Charging
paths:
  /markets:
    get:
      tags:
        - Market Operations
      summary: List Markets
      description: >-
        Search markets via Polymarket public-search by keyword, status, sorting
        and pagination.
      operationId: searchMarkets
      parameters:
        - name: q
          in: query
          required: true
          description: >-
            Global search keyword (required). Backed by Polymarket
            public-search.
          schema:
            type: string
            minLength: 1
            maxLength: 100
        - name: limit
          in: query
          required: false
          description: Per-type result count (limit_per_type), default 20
          schema:
            type: integer
            default: 20
            minimum: 0
        - name: page
          in: query
          required: false
          description: 1-indexed page number, default 1
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: order
          in: query
          required: false
          description: Sort field, e.g. volume24hr / liquidity / volume
          schema:
            type: string
            maxLength: 200
        - name: ascending
          in: query
          required: false
          description: Sort ascending (default false = descending)
          schema:
            type: boolean
            default: false
        - name: eventsStatus
          in: query
          required: false
          description: Event status filter (default active)
          schema:
            type: string
            enum:
              - active
              - resolved
              - closed
            default: active
        - name: closed
          in: query
          required: false
          description: Only return closed markets (default false)
          schema:
            type: boolean
            default: false
        - name: venue
          in: query
          required: false
          description: Trading venue (default polymarket)
          schema:
            type: string
            default: polymarket
            maxLength: 50
      responses:
        '200':
          description: Matching markets
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/MarketSummary'
                  total:
                    type: integer
components:
  schemas:
    MarketSummary:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        status:
          type: string
        yesPrice:
          type: number
        noPrice:
          type: number
        volume:
          type: number
        endDate:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-default: YOUR_API_KEY

````