# 期货实时行情接口

## 1. 获取商品期货清单

Infoway期货行情API支持查询30种期货产品（包含各类期货指数）。您可以通过以下两种方式获取期货产品清单：

* **下载清单文件**：登录您的账户后台，在底部找到文件下载链接。
* **通过HTTP接口查询**：如需通过接口获取期货清单，请参考[GET查询产品列表](/rest-api/basic-info/get-symbol-list.md)。

## 2. 查询方式

我们为不同需求的用户提供两种高效的期货行情查询方式：

| 查询方式        | 适用场景                                                               |
| ----------- | ------------------------------------------------------------------ |
| HTTP接口      | 适用于定期或批量查询的用户，支持灵活的查询请求。通过HTTP接口，您可以查询A股上市公司的基础信息、历史行情、实时K线、盘口等数据。 |
| WebSocket订阅 | 适合用于获取快速更新的实时行情数据，确保您获取最低延迟的行情推送。                                  |

{% hint style="info" %}
HTTP或者WebSocket均对查询频率有限制，详细限制说明请见[此页面](/getting-started/api-limitation.md)。
{% endhint %}

## 3. 支持的数据类型

Infoway期货实时行情接口提供以下几种数据查询服务：

### 3.1 获取期货实时K线

提供实时的期货K线行情数据，包括开盘、最高、最低、收盘价格、成交量、成交额、涨跌幅、涨跌额，帮助用户捕捉市场走势。详细了解如何获取K线，请前往

* [HTTP请求K线](/rest-api/http-endpoints/get-candles.md)
* [WebSocket订阅K线](/websocket-api/subscribe-and-unsubscribe/candles-subscribe.md)。

以下是白银（XAGUSD）的实时K线返回示例：

<pre><code>{
  "s": "XAGUSD",    //产品代码
  "respList": [
    {
      "t": "1752868800",  //秒时间戳（UTC+8）
      "h": "38.22500",    //最高价
      "o": "38.12555",    //开盘价
      "l": "38.11850",    //最低价
      "c": "38.16500",    //收盘价
      "v": "1003.0",    //成交量
      "vw": "38292.383500",    //成交额
      "pc": "0.12%",    //涨跌幅
      "pca": "0.04450"    //涨跌额
<strong>    }
</strong>  ]
}
</code></pre>

### 3.2 期货**实时成交明细**

查询期货的最新成交明细，确保获取市场的最新交易信息。详细接入方法请前往：

* [GET实时成交明细](/rest-api/http-endpoints/get-trade.md)
* [WebSocket订阅成交明细](/websocket-api/subscribe-and-unsubscribe/trade-subscribe.md)

实时成交明细返回示例如下：

```
{
  "s": "XAGUSD",    //产品代码
  "t": 1752872345319,    //毫秒时间戳(UTC+8)
  "p": "38.165",    //交易价格
  "v": "1.0",    //成交量
  "vw": "38.1650",    //成交额
  "td": 0    //交易方向 1：BUY 2：SELL 0：默认值
}
```

### 3.3 期货**盘口数据**

Infoway API提供商品期货的买卖盘口查询，帮助用户了解市场深度和流动性。详细接入步骤请前往：

* [GET查询盘口数据](/rest-api/http-endpoints/get-depth.md)
* [WebSocket订阅盘口数据](/websocket-api/subscribe-and-unsubscribe/depth-subscribe.md)

买卖盘口返回示例如下：

```
{
  "s": "XAGUSD",    //产品代码 
  "t": 1752975504045,    //毫秒时间戳(UTC+8)
  "a": [
    [
      "38.18"    //买一价
    ],
    [
      "1"    //买一量
    ]
  ],
  "b": [
    [
      "38.15"    //卖一价
    ],
    [
      "1"    //卖一量
    ]
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/readme/future-realtime-market-data-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
