# 常用指数代码对照表

> 获取常用指数代码对照表

## 接口基本信息

- **接口名称**: `get_common_index_codes`
- **功能描述**: 获取常用指数代码对照表，覆盖A股、港股、美股主要指数
- **数据更新频率**: 静态数据
- **请求方法**: `POST`
- **API 路径**: `https://api.wanxingai.com/openapi/get_common_index_codes/`

---

---

### 返回数据说明

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| name | string | 指数名称 |
| code | string | 指数代码（含交易所后缀） |

## 使用示例

```python
import requests

url = "https://api.wanxingai.com/openapi/get_common_index_codes/"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer sk-********"
}

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

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

HttpClient client = HttpClient.newHttpClient();
String json = "{}";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wanxingai.com/openapi/get_common_index_codes/"))
    .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_common_index_codes/ \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer sk-********" \\
  -d '{}'
```

### 注意事项

1. 无需传入任何参数，直接调用即可获取全部常用指数代码
2. 覆盖 A 股主要指数、港股指数、美股指数
