# 股票基本信息

> 获取股票基本信息

## 接口基本信息

- **接口名称**：`get_stock_basic_info`
- **功能描述**：查询 A 股股票基本信息，包括股票简称、上市资料、所属行业、概念和主营业务等。
- **请求方法**：`POST`
- **API 路径**：`https://api.wanxingai.com/openapi/get_stock_basic_info/`

## 输入参数

| 参数名 | 类型 | 必选 | 默认值 | 说明 | 示例 |
| --- | --- | --- | --- | --- | --- |
| `stock_code` | string | 是 | 无 | 完整股票代码，需带交易所后缀；多只股票用英文逗号分隔 | `600519.SH` |
| `date` | string | 否 | 当天 | 查询日期，格式 `YYYY-MM-DD`。适用于申万行业、所属概念和主营业务 | `2025-09-30` |

同一次请求中的所有股票使用同一个查询日期。不传 `date` 时保持原有行为。其余指标沿用各自的查询口径，不随 `date` 改变；这不是所有指标的历史快照。无效日期会返回业务状态 `201`。

## 调用示例

```curl
curl -X POST https://api.wanxingai.com/openapi/get_stock_basic_info/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-********" \
  -d '{"stock_code":"600519.SH","date":"2025-09-30"}'
```

```python
import requests

response = requests.post(
    "https://api.wanxingai.com/openapi/get_stock_basic_info/",
    headers={"Authorization": "Bearer sk-********"},
    json={"stock_code": "600519.SH", "date": "2025-09-30"},
)
print(response.json())
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String json = """
    {"stock_code":"600519.SH","date":"2025-09-30"}
    """;

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

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

## 返回数据

成功时返回 `{"status": 200, "message": [...]}`，`message` 按股票分组。

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `message[].thscode` | string | 标准股票代码 |
| `message[].data` | array | 指标列表 |
| `message[].data[].indicator` | string | 指标名 |
| `message[].data[].description` | string | 指标说明 |
| `message[].data[].value` | 任意 | 指标值，以数据源实际返回为准 |

### 指标列表

| 指标名 | 说明 | 使用查询日期 |
| --- | --- | --- |
| `stock_short_name_stock` | 股票简称 | 否 |
| `en_short_name_stock` | 英文简称 | 否 |
| `phonetic_short_name_stock` | 简称首拼 | 否 |
| `sec_name_used_before_stock` | 证券曾用名 | 否 |
| `stock_code_stock` | 股票代码 | 否 |
| `ipo_date_stock` | 首发上市日期 | 否 |
| `listing_exchange_stock` | 上市交易所 | 否 |
| `listedsector_stock` | 上市板块 | 否 |
| `listed_status_stock` | 上市状态 | 否 |
| `trade_currency_stock` | 交易币种 | 否 |
| `the_sw_industry_stock` | 申万行业 | 是 |
| `the_concept_stock` | 所属概念 | 是 |
| `main_businuess_stock` | 主营业务 | 是 |
| `is_risk_warning_board_stock` | 是否属于风险警示板 | 否 |
| `is_important_index_constituent_stock` | 是否属于重要指数成分 | 否 |
| `index_weight_stock` | 所属指数权重 | 否 |
| `is_mt_ss_underlying_stock` | 是否融资融券标的 | 否 |
| `is_shhk_buy_underlying_stock` | 是否沪港通买入标的 | 否 |
| `is_szhk_buy_underlying_stock` | 是否深港通买入标的 | 否 |
| `is_subnew_stock_stock` | 是否为次新股 | 否 |
