如果你正在构建筛选器、市场选择器、日期校验或分类面板,这一组接口应该最先接入。它们提供的是后续所有查询都会依赖的基础字典。
市场基础信息
GET
/api/v1/marketsList supported markets
listMarkets
该接口未定义请求参数。
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | Market collection | MarketCollectionResponse |
| 401 | Unauthorized | ErrorResponse |
MarketCollectionResponse
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | Array<Market> | 是 | — |
| data[].id | MarketId | 是 | — |
| data[].name | string | 是 | — |
| meta | Meta | 是 | — |
| meta.next_cursor | string | null | 是 | — |
| links | SelfLinks | 是 | — |
| links.self | string | 是 | — |
GET
/api/v1/markets/{market}Get one market
getMarket
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | Market resource | MarketResponse |
| 401 | Unauthorized | ErrorResponse |
| 404 | Resource not found | ErrorResponse |
交易日历
GET
/api/v1/markets/{market}/trading-daysList trading days for one market
listTradingDays
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| market | path | MarketId | 是 | — |
| from | query | string (date) | 否 | — |
| to | query | string (date) | 否 | — |
| page[size] | query | integer (default 100) | 否 | — |
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | Trading day collection | TradingDayCollectionResponse |
| 400 | Invalid request parameters | ErrorResponse |
| 401 | Unauthorized | ErrorResponse |
| 404 | Resource not found | ErrorResponse |
TradingDayCollectionResponse
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | Array<TradingDay> | 是 | — |
| data[].market | MarketId | 是 | — |
| data[].date | string (date) | 是 | — |
| meta | Meta | 是 | — |
| meta.next_cursor | string | null | 是 | — |
| links | SelfLinks | 是 | — |
| links.self | string | 是 | — |
这类接口适合:
- 回测或数据下载前先校验日期是否合法
- 前端日历组件只展示交易日
- 避免在节假日或停市日上做无意义请求
行业与板块分类
GET
/api/v1/classifications/sectorsList sector classifications
listSectors
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | Sector collection | ClassificationCollectionResponse |
| 401 | Unauthorized | ErrorResponse |
GET
/api/v1/classifications/primary-industriesList primary industries
listPrimaryIndustries
| 状态码 | 说明 | Schema |
|---|---|---|
| 200 | Primary industry collection | ClassificationCollectionResponse |
| 401 | Unauthorized | ErrorResponse |
ClassificationCollectionResponse
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | Array<Classification> | 是 | — |
| data[].id | string | 是 | — |
| data[].name | string | 是 | — |
| data[].type | string | 是 | — |
| meta | Meta | 是 | — |
| meta.next_cursor | string | null | 是 | — |
| links | SelfLinks | 是 | — |
| links.self | string | 是 | — |
按行业初始化过滤器bash
curl https://heliumlabz.com/api/v1/classifications/sectors \
-H "X-API-Key: $ASHARE_API_KEY"