> For the complete documentation index, see [llms.txt](https://docscn.jkidata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docscn.jkidata.com/cai-wu-shu-ju/xing-ye-ban-kuai-lie-biao-jie-kou-performance-list.md).

# 📊 行业板块列表接口（Performance List）

## 📊 行业板块列表接口（Performance List）

获取指定国家的行业或板块表现数据，包括涨跌幅、成交量、成分数量、股息收益率以及不同周期的表现指标。

### 接口信息

```
GET /performance_list
```

> 本页面使用相对路径。API 基础地址请参考「财务数据」首页。

### 请求参数

| 参数         | 类型     | 必填 | 示例             | 说明                         |
| ---------- | ------ | -- | -------------- | -------------------------- |
| `country`  | string | 是  | `india`        | 国家代码                       |
| `type`     | string | 是  | `industry`     | 数据类型：`industry` 或 `sector` |
| `language` | string | 是  | `en`           | 返回内容的语言                    |
| `key`      | string | 是  | `YOUR_API_KEY` | API 访问密钥                   |

### `type` 参数说明

| 参数值        | 说明              |
| ---------- | --------------- |
| `industry` | 返回行业列表，分类通常更加详细 |
| `sector`   | 返回板块列表，分类通常更加宽泛 |

### 获取行业列表

```
GET /performance_list?country=india&type=industry&language=en&key=YOUR_API_KEY
```

#### cURL

```
curl --request GET \
  "$JKIDATA_BASE_URL/performance_list?country=india&type=industry&language=en&key=$JKIDATA_API_KEY"
```

### 获取板块列表

```
GET /performance_list?country=india&type=sector&language=en&key=YOUR_API_KEY
```

#### cURL

```
curl --request GET \
  "$JKIDATA_BASE_URL/performance_list?country=india&type=sector&language=en&key=$JKIDATA_API_KEY"
```

### Python 示例

```
import requests

url = f"{JKIDATA_BASE_URL}/performance_list"

params = {
    "country": "india",
    "type": "industry",
    "language": "en",
    "key": JKIDATA_API_KEY,
}

response = requests.get(url, params=params, timeout=15)
response.raise_for_status()

result = response.json()

for item in result.get("data", []):
    print(item.get("name"), item.get("change"))
```

### JavaScript 示例

```
const params = new URLSearchParams({
  country: "india",
  type: "industry",
  language: "en",
  key: process.env.JKIDATA_API_KEY,
});

const response = await fetch(
  `${process.env.JKIDATA_BASE_URL}/performance_list?${params}`
);

if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}

const result = await response.json();

for (const item of result.data ?? []) {
  console.log(item.name, item.change);
}
```

### 成功响应示例

```
{
  "status": 0,
  "message": "SUCCESS",
  "data": [
    {
      "id": "example-id",
      "name": "Financial Services",
      "type": "industry",
      "language": "en",
      "country": "india",
      "sector": "Finance",
      "change": 0.82,
      "stocks": 128,
      "elements": 128,
      "volume": 245678900,
      "dividends_yield": 1.34,
      "perf_w": 1.25,
      "perf_1m": 3.48,
      "perf_3m": 6.12,
      "perf_6m": 8.76,
      "perf_ytd": 11.52,
      "perf_y": 15.31,
      "perf_5y": 68.42,
      "perf_10y": 132.75,
      "perf_all": 245.68,
      "fundamental_currency_code": "INR"
    }
  ]
}
```

> 示例中的数值仅用于说明数据结构，不代表当前实时表现。实际响应可能包含其他字段。

### 响应结构

| 字段        | 类型     | 说明                |
| --------- | ------ | ----------------- |
| `status`  | number | 业务状态码，`0` 表示请求成功  |
| `message` | string | 请求结果说明            |
| `data`    | array  | 行业或板块数据列表         |
| `total`   | number | 数据总数；部分响应可能返回 `0` |
| `page`    | number | 当前页码；不分页时可能返回 `0` |

### `data` 主要字段

| 字段                          | 类型            | 说明                         |
| --------------------------- | ------------- | -------------------------- |
| `id`                        | string        | 行业或板块的唯一标识                 |
| `name`                      | string        | 行业或板块名称                    |
| `type`                      | string        | 数据类型：`industry` 或 `sector` |
| `language`                  | string        | 数据语言                       |
| `country`                   | string        | 所属国家                       |
| `sector`                    | string / null | 所属板块                       |
| `change`                    | number / null | 当前涨跌幅，通常为百分比数值             |
| `stocks`                    | number / null | 包含的股票数量                    |
| `elements`                  | number / null | 成分数量                       |
| `volume`                    | number / null | 成交量                        |
| `dividends_yield`           | number / null | 股息收益率                      |
| `fundamental_currency_code` | string / null | 财务数据使用的货币代码                |
| `perf_w`                    | number / null | 最近一周表现                     |
| `perf_1m`                   | number / null | 最近一个月表现                    |
| `perf_3m`                   | number / null | 最近三个月表现                    |
| `perf_6m`                   | number / null | 最近六个月表现                    |
| `perf_ytd`                  | number / null | 年初至今表现                     |
| `perf_y`                    | number / null | 最近一年表现                     |
| `perf_5y`                   | number / null | 最近五年表现                     |
| `perf_10y`                  | number / null | 最近十年表现                     |
| `perf_all`                  | number / null | 全部时间表现                     |

> 表现类字段通常以百分比数值返回。正数表示上涨，负数表示下跌。

### 数据兼容说明

`industry` 和 `sector` 返回的字段可能略有不同。例如，部分板块数据可能不提供成交量或长期表现字段。

客户端应使用可选字段方式解析：

#### JavaScript

```
const change = item.change ?? null;
const volume = item.volume ?? null;
const performance = item.perf_ytd ?? null;
```

#### Python

```
change = item.get("change")
volume = item.get("volume")
performance = item.get("perf_ytd")
```

### 注意事项

* `type` 只使用 `industry` 或 `sector`。
* `country` 和 `language` 必须使用支持的参数值。
* 该接口可能返回较大的数据数组，请避免高频重复请求。
* 不同国家的行业分类和字段完整度可能存在差异。
* 数值字段可能为空、缺失或返回 `null`。
* 客户端不应依赖固定的数组顺序或字段数量。
* 请勿在前端代码或公共代码仓库中暴露真实 API Key。
