# 日内快照数据

> 查询日内快照数据

## 接口基本信息

- **接口名称**: `get_intraday_snapshot`
- **功能描述**: 获取股票日内逐笔快照数据（starttime 与 endtime 须在同一交易日）
- **数据更新频率**: 实时
- **请求方法**: `POST`
- **API 路径**: `https://api.wanxingai.com/openapi/get_intraday_snapshot/`

---

---

## 使用示例

```python
import requests

url = "https://api.wanxingai.com/openapi/get_intraday_snapshot/"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer sk-********"
}
payload = {
    "stock_code": "300033.SZ",
    "indicators": "tradeDate,tradeTime,latest,vol,bid1,ask1",
    "starttime": "2025-08-25 09:30:00",
    "endtime": "2025-08-25 15:00:00"
}

resp = requests.post(url, json=payload, headers=headers)
print(resp.json())
```

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
String json = """
    {"stock_code": "300033.SZ", "indicators": "tradeDate,tradeTime,latest,vol,bid1,ask1",
     "starttime": "2025-08-25 09:30:00", "endtime": "2025-08-25 15:00:00"}
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wanxingai.com/openapi/get_intraday_snapshot/"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer sk-********")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```curl
curl -X POST https://api.wanxingai.com/openapi/get_intraday_snapshot/ \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer sk-********" \\
  -d '{"stock_code": "300033.SZ", "indicators": "tradeDate,tradeTime,latest,vol,bid1,ask1", "starttime": "2025-08-25 09:30:00", "endtime": "2025-08-25 15:00:00"}'
```

## 输入参数说明

| 参数名 | 类型 | 必选 | 描述 | 示例 |
| --- | --- | --- | --- | --- |
| `stock_code` | str | **是** | 完整股票代码，多个用英文逗号分隔。支持最多10个 | `600519.SH` |
| `indicators` | str | **是** | 指标，英文逗号分隔。常用：tradeDate,tradeTime,preClose,open,high,low,latest,vol,amount,bid1,ask1,bidSize1,askSize1 | `latest,vol,amount` |
| `starttime` | str | **是** | 开始时间 "YYYY-MM-DD HH:mm:ss" | `2025-08-25 09:30:00` |
| `endtime` | str | **是** | 结束时间 "YYYY-MM-DD HH:mm:ss"，须与 starttime 同一天 | `2025-08-25 15:00:00` |

### 返回数据说明

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| code | string | 股票代码 |
| time | string[] | 交易时间序列（3秒级精度） |
| table.tradeDate | string[] | 交易日期 |
| table.tradeTime | string[] | 交易时间（HH:mm:ss） |
| table.preClose | float[] | 前收盘价 |
| table.open | float[] | 开盘价 |
| table.high | float[] | 最高价 |
| table.low | float[] | 最低价 |
| table.latest | float[] | 最新价 |
| table.vol | float[] | 成交量 |
| table.amount | float[] | 成交额 |
| table.bid1 | float[] | 买一价 |
| table.ask1 | float[] | 卖一价 |
| table.bidSize1 | float[] | 买一量 |
| table.askSize1 | float[] | 卖一量 |

---

### 常用财务指标

| 指标名 | 中文含义 |
| --- | --- |
| `ths_roe_stock` | 净资产收益率（ROE） |
| `ths_net_profit_stock` | 归母净利润 |
| `ths_total_revenue_stock` | 营业总收入 |
| `ths_eps_stock` | 每股收益（EPS） |
| `ths_asset_liability_ratio_stock` | 资产负债率 |

---

### 返回数据说明

| 字段名 | 类型 | 描述 |
| --- | --- | --- |
| `code` | str | 标准股票代码 |
| `time` | array[str] | 日期序列数组，格式 YYYY-MM-DD |
| `table` | object | 指标数据对象，字段名与传入的 indicator 参数名称对应 |

---
