# 获取 Kalshi 交易

**API:** Data API

**Endpoint:** `GET /v1/beta/kalshi/trades`

**Tags:** 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`。

### 计费参考

- 计量方式：按成功请求的固定成本计费。
- 参考请求估算：0.02 美元。

仅供参考的元数据，不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `cursor` | query | no | string | 分页游标。使用上一次响应返回的游标值获取下一页结果。第一页留空。 |
| `is_block_trade` | query | no | boolean | 按是否为大宗交易筛选成交。省略则返回所有成交。设为 `true` 仅返回大宗交易，设为 `false` 仅返回非大宗交易。 |
| `limit` | query | no | integer, (int64), default: 100 | 每页结果数。默认 100，最大值为 1000。 |
| `max_ts` | query | no | integer, (int64) | 筛选在该 Unix 时间戳之前的条目 |
| `min_ts` | query | no | integer, (int64) | 筛选在该 Unix 时间戳之后的条目 |
| `ticker` | query | no | string | 按市场 ticker 筛选 |

## Responses

### 200 — 交易获取成功

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

Schema: `Response24B585A0A861_GetTradesResponse` (`#/components/schemas/Response24B585A0A861_GetTradesResponse`)

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response24B585A0A861_BookSide

`#/components/schemas/Response24B585A0A861_BookSide`

```json
{
  "type": "string",
  "enum": [
    "bid",
    "ask"
  ],
  "description": "订单或成交在订单簿中的方向。对于事件市场，这仅指 YES 一侧：`bid` 表示买入 YES，`ask` 表示卖出 YES。（卖出 YES 在经济上等同于以 `1 - price` 买入 NO，但此端点始终从 YES 一侧报价。）"
}
```

### Response24B585A0A861_FixedPointCount

`#/components/schemas/Response24B585A0A861_FixedPointCount`

```json
{
  "type": "string",
  "description": "定点合约数量字符串（2 位小数，例如 \"10.00\"；在字段名中称为 \"fp\"）。请求接受 0–2 位小数（例如 \"10\"、\"10.0\"、\"10.00\"）；响应始终输出 2 位小数。支持小数合约值（例如 \"2.50\"）；最小粒度为 0.01 份合约。",
  "example": "10.00"
}
```

### Response24B585A0A861_FixedPointDollars

`#/components/schemas/Response24B585A0A861_FixedPointDollars`

```json
{
  "type": "string",
  "description": "定点美元字符串。多数请求字段接受 2–4 位小数（例如 \"0.56\"、\"0.5600\"）；响应最多输出 6 位小数。给定市场的有效报价间隔受该市场价格档位结构约束。",
  "example": "0.5600"
}
```

### Response24B585A0A861_GetTradesResponse

`#/components/schemas/Response24B585A0A861_GetTradesResponse`

```json
{
  "type": "object",
  "required": [
    "trades",
    "cursor"
  ],
  "properties": {
    "trades": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Response24B585A0A861_Trade"
      }
    },
    "cursor": {
      "type": "string"
    }
  }
}
```

### Response24B585A0A861_Trade

`#/components/schemas/Response24B585A0A861_Trade`

```json
{
  "type": "object",
  "required": [
    "trade_id",
    "ticker",
    "count_fp",
    "yes_price_dollars",
    "no_price_dollars",
    "taker_outcome_side",
    "taker_book_side",
    "created_time",
    "is_block_trade"
  ],
  "properties": {
    "trade_id": {
      "type": "string",
      "description": "该笔成交的唯一标识符"
    },
    "ticker": {
      "type": "string",
      "description": "市场的唯一标识符"
    },
    "count_fp": {
      "$ref": "#/components/schemas/Response24B585A0A861_FixedPointCount"
    },
    "yes_price_dollars": {
      "$ref": "#/components/schemas/Response24B585A0A861_FixedPointDollars"
    },
    "no_price_dollars": {
      "$ref": "#/components/schemas/Response24B585A0A861_FixedPointDollars"
    },
    "taker_side": {
      "type": "string",
      "enum": [
        "yes",
        "no"
      ],
      "x-enum-varnames": [
        "TradeTakerSideYes",
        "TradeTakerSideNo"
      ],
      "deprecated": true,
      "x-go-type-skip-optional-pointer": true,
      "description": "已弃用。请改用 `taker_outcome_side`（或 `taker_book_side`）。参见[订单方向](/getting_started/order_direction)。此字段不会在 2026 年 5 月 14 日之前移除。\n"
    },
    "taker_outcome_side": {
      "type": "string",
      "enum": [
        "yes",
        "no"
      ],
      "x-enum-varnames": [
        "TradeTakerOutcomeSideYes",
        "TradeTakerOutcomeSideNo"
      ],
      "description": "taker 所持的结果方向。buy-yes 和 sell-no 产生 'yes'；buy-no 和 sell-yes 产生 'no'。\n\n`taker_outcome_side` 仅描述方向性敞口，不改变成交价格。价格为 `p`、`taker_outcome_side=no` 的成交，会与方向相反、价格同为 `p` 的 maker 撮合——双方以相同价格成交。\n\n`taker_outcome_side` 和 `taker_book_side` 将成为判定成交方向的标准方式。旧版 `taker_side` 字段将在未来版本中弃用——请迁移到这些新字段。\n"
    },
    "taker_book_side": {
      "$ref": "#/components/schemas/Response24B585A0A861_BookSide"
    },
    "created_time": {
      "type": "string",
      "format": "date-time",
      "description": "该笔成交的执行时间戳"
    },
    "is_block_trade": {
      "type": "boolean",
      "description": "若该笔成交作为大额协议交易在订单簿之外撮合（例如通过 RFQ / 协商大额协议提案）则为 true；在标准订单簿上成交的为 false。"
    }
  }
}
```
