> ## 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.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 获取 Kalshi 交易

> 获取 Kalshi 市场的成交明细——是实际成交，而不是报价。

获取 Kalshi 市场的成交明细——是实际成交，而不是报价。当你需要某个时间窗口内的成交价格和成交量，例如观察事件推进过程中市场信心如何变化时使用；可用 `ticker` 和 `min_ts` / `max_ts`（Unix 秒）区间收窄范围，并用 `is_block_trade` 单独筛出大额协商交易。

返回 `trades[]`，包含 `trade_id`、`ticker`、`count_fp`（合约张数）、`yes_price_dollars` / `no_price_dollars`、`taker_side` 和 `created_time`，并附带用于分页的 `cursor`。

如需当前报价、结算规则和市场元数据而不是成交明细，请使用 [`get_kalshi_markets`](https://aisa.one/docs/zh/api-reference/prediction-market/get_kalshi-markets)。

> [!NOTE]
>
> **第一次用？** 把任意 MCP 客户端指向 `https://mcp.aisa.one/mcp` —— Claude Code、
> Codex、Cursor、VS Code 都可以。鉴权走 OAuth：客户端打开浏览器，你点一次
> Allow，不需要粘贴任何 key。之后智能体通过几个元工具调用所有端点：
> `search`、`list_categories`、`get_details` 和 `batch_quote` 免费，`batch_use`
> 按次计费。各客户端的接入步骤见[通过 MCP 连接](https://aisa.one/docs/zh/agent-quickstart.md)；实时工具列表和
> 每次调用的价格见 [aisa.one/zh-cn/mcp](https://aisa.one/zh-cn/mcp#connect)。

[在你的 agent 里把这个端点跑起来 →](https://aisa.one/mcp?from=/zh/api-reference/prediction-market/get_kalshi-trades)

## 请求规范

* **方法与路径:** GET /apis/v1/kalshi/trades
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/kalshi/trades`
* **cursor:** query; 可选
* **is\_block\_trade:** query; 可选
* **limit:** query; 可选
* **max\_ts:** query; 可选
* **min\_ts:** query; 可选
* **ticker:** query; 可选

[完整 OpenAPI 定义](https://aisa.one/docs/openapi/zh/kalshi-unauthorized.json)

有效请求声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "get_kalshi_trades",
  "method": "GET",
  "path": "/apis/v1/kalshi/trades",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "description": "Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.",
      "in": "query",
      "name": "cursor",
      "schema": {
        "type": "string",
        "x-go-type-skip-optional-pointer": true
      }
    },
    {
      "description": "Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades.\n",
      "in": "query",
      "name": "is_block_trade",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "description": "Number of results per page. Defaults to 100. Maximum value is 1000.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 100,
        "format": "int64",
        "maximum": 1000,
        "minimum": 0,
        "type": "integer",
        "x-oapi-codegen-extra-tags": {
          "validate": "omitempty,gte=0,lte=1000"
        }
      }
    },
    {
      "description": "Filter items before this Unix timestamp",
      "in": "query",
      "name": "max_ts",
      "schema": {
        "format": "int64",
        "type": "integer"
      }
    },
    {
      "description": "Filter items after this Unix timestamp",
      "in": "query",
      "name": "min_ts",
      "schema": {
        "format": "int64",
        "type": "integer"
      }
    },
    {
      "description": "Filter by market ticker",
      "in": "query",
      "name": "ticker",
      "schema": {
        "type": "string",
        "x-go-type-skip-optional-pointer": true
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

公开参考价格：每次成功请求 \$0.02 USD。 账户适用价格可能不同；支持报价的接口可按实际请求获取报价。


## OpenAPI

````yaml openapi/zh/kalshi-unauthorized.json GET /apis/v1/kalshi/trades
openapi: 3.1.0
info:
  description: ''
  title: kalshi-unauthorized
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    kalshi-unauthorized:
      description: ''
      title: kalshi-unauthorized
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 1cb9c86abd2764bf5fd2b2807cd6239713dcf291769a3199c126757c53c845aa
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/kalshi/markets
    - /apis/v1/kalshi/markets/{ticker}
    - /apis/v1/kalshi/markets/{ticker}/orderbook
    - /apis/v1/kalshi/trades
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:ed1b240c061963308df889e62c08e38b3fc401e6989d5af91edd257fcd04d9a2
    facts_hash: 1cb9c86abd2764bf5fd2b2807cd6239713dcf291769a3199c126757c53c845aa
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: kalshi-unauthorized
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/kalshi/trades:
    get:
      tags:
        - default
      summary: 获取 Kalshi 交易
      description: >-
        Endpoint for getting all trades for all markets. A trade represents a
        completed transaction between two users on a specific market. Each trade
        includes the market ticker, price, quantity, and timestamp information.
        Block trades are included in the response by default and identified by
        the `is_block_trade` field; use the `is_block_trade` query parameter to
        filter by block / non-block. This endpoint returns a paginated response.
        Use the 'limit' parameter to control page size (1-1000, defaults to
        100). The response includes a 'cursor' field - pass this value in the
        'cursor' parameter of your next request to get the next page. An empty
        cursor indicates no more pages are available.


        默认价格配置
      operationId: get_kalshi_trades
      parameters:
        - description: >-
            Pagination cursor. Use the cursor value returned from the previous
            response to get the next page of results. Leave empty for the first
            page.
          in: query
          name: cursor
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
        - description: >
            Filter trades by whether they are block trades. Omit to return all
            trades. Set to `true` to return only block trades. Set to `false` to
            return only non-block trades.
          in: query
          name: is_block_trade
          schema:
            type: boolean
        - description: 每页结果数。默认为 100，最大值为 1000。
          in: query
          name: limit
          schema:
            default: 100
            format: int64
            maximum: 1000
            minimum: 0
            type: integer
            x-oapi-codegen-extra-tags:
              validate: omitempty,gte=0,lte=1000
        - description: Filter items before this Unix timestamp
          in: query
          name: max_ts
          schema:
            format: int64
            type: integer
        - description: Filter items after this Unix timestamp
          in: query
          name: min_ts
          schema:
            format: int64
            type: integer
        - description: Filter by market ticker
          in: query
          name: ticker
          schema:
            type: string
            x-go-type-skip-optional-pointer: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response3868Ab39519D_GetTradesResponse'
          description: Trades retrieved successfully
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  schemas:
    Response3868Ab39519D_GetTradesResponse:
      properties:
        cursor:
          type: string
        trades:
          items:
            $ref: '#/components/schemas/Response3868Ab39519D_Trade'
          type: array
      required:
        - trades
        - cursor
      type: object
    Response3868Ab39519D_Trade:
      properties:
        count_fp:
          $ref: '#/components/schemas/Response3868Ab39519D_FixedPointCount'
        created_time:
          description: Timestamp when this trade was executed
          format: date-time
          type: string
        is_block_trade:
          description: >-
            True if this trade was matched off-book as a block trade (e.g. via
            RFQ / negotiated block proposal); false for trades that filled on
            the standard order book.
          type: boolean
        no_price_dollars:
          $ref: '#/components/schemas/Response3868Ab39519D_FixedPointDollars'
        taker_book_side:
          $ref: '#/components/schemas/Response3868Ab39519D_BookSide'
        taker_outcome_side:
          description: >
            The outcome side the taker is positioned for. buy-yes and sell-no
            produce 'yes'; buy-no and sell-yes produce 'no'.


            `taker_outcome_side` describes directional exposure only; it does
            not change the trade's price. A trade at price `p` with
            `taker_outcome_side=no` is matched against the maker at the same
            price `p` with the opposite direction — both parties trade at the
            same price.


            `taker_outcome_side` and `taker_book_side` will become the canonical
            way to determine trade direction. The legacy `taker_side` field will
            be deprecated in a future release — please migrate to these new
            fields.
          enum:
            - 'yes'
            - 'no'
          type: string
          x-enum-varnames:
            - TradeTakerOutcomeSideYes
            - TradeTakerOutcomeSideNo
        taker_side:
          deprecated: true
          description: >
            Deprecated. Use `taker_outcome_side` (or `taker_book_side`) instead.
            See [Order direction](/getting_started/order_direction). This field
            will not be removed before May 14, 2026.
          enum:
            - 'yes'
            - 'no'
          type: string
          x-enum-varnames:
            - TradeTakerSideYes
            - TradeTakerSideNo
          x-go-type-skip-optional-pointer: true
        ticker:
          description: Unique identifier for the market
          type: string
        trade_id:
          description: Unique identifier for this trade
          type: string
        yes_price_dollars:
          $ref: '#/components/schemas/Response3868Ab39519D_FixedPointDollars'
      required:
        - trade_id
        - ticker
        - count_fp
        - yes_price_dollars
        - no_price_dollars
        - taker_outcome_side
        - taker_book_side
        - created_time
        - is_block_trade
      type: object
    Response3868Ab39519D_FixedPointCount:
      description: >-
        Fixed-point contract count string (2 decimals, e.g., "10.00"; referred
        to as "fp" in field names). Requests accept 0-2 decimal places (e.g.,
        "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional
        contract values (e.g., "2.50") are supported; the minimum granularity is
        0.01 contracts.
      example: '10.00'
      type: string
    Response3868Ab39519D_FixedPointDollars:
      description: >-
        Fixed-point US dollar string. Most request fields accept 2-4 decimal
        places (e.g., "0.56", "0.5600"); responses emit up to 6. Valid quote
        intervals for a given market are constrained by that market's price
        level structure.
      example: '0.5600'
      type: string
    Response3868Ab39519D_BookSide:
      description: >-
        Side of the book for an order or trade. For event markets, this refers
        to the YES leg only: `bid` means buy YES, `ask` means sell YES. (Selling
        YES is economically equivalent to buying NO at `1 - price`, but this
        endpoint quotes everything from the YES side.)
      enum:
        - bid
        - ask
      type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.