Historical Industry Performance细分行业历史表现
该接口提供生物科技、科技、金融服务等各细分行业的历史涨跌数据,覆盖主要交易所,用于追踪行业长期走势、比较不同板块的强弱变化。
https://quote-fmp.com/stable/historical-industry-performance?industry=Biotechnology数据更新周期
1 Hour
接口说明
- 行业级历史数据:查询特定细分行业的表现数据,包括一段时间内的平均涨跌幅,传入
industry后可汇总industry(细分行业)、exchange(交易所代码)与averageChange(平均涨跌幅) 等要素,可直接嵌入日常投研监控脚本。 - 分交易所表现:查看各细分行业在 NASDAQ、NYSE 等主要交易所上的表现,读取
industry(细分行业)与exchange(交易所代码) 等结构化数值后,可直接对接估值模型或风控阈值检查。 - 长期趋势分析:通过历史数据识别细分行业的长期趋势与市场切换,研究端可将本接口与「细分行业表现快照」组合编排,覆盖从概览快照到历史序列的需求。
- 关联数据线接口:Historical Industry PE(细分行业历史市盈率) · Biggest Stock Gainers(涨幅榜) · Available Sectors(可用板块清单) · Available Industries(可用细分行业清单)
请求参数
4 个参数| 参数 | 类型 | 要求 | 示例 | 说明 |
|---|---|---|---|---|
industry | string | 必填 | Biotechnology | 细分行业(industry),如 Software、Biotechnology,用于筛选股票。 |
exchange | string | 可选 | NASDAQ | 目标交易所代码或名称,如 NASDAQ、NYSE、AMEX。 |
from | string | 可选 | 2024-02-01 | 查询起始日期,格式 YYYY-MM-DD,包含当天。 |
to | string | 可选 | 2024-03-01 | 查询结束日期,格式 YYYY-MM-DD,包含当天。 |
调用代码示例
Python 关键代码请求 细分行业历史表现(/stable/historical-industry-performance,必填 industry),解析后可得 industry(细分行业)、exchange(交易所代码)、averageChange(平均涨跌幅) 共 4 项数据。
resp = requests.get(
"https://quote-fmp.com/stable/historical-industry-performance",
params={"industry": "Biotechnology", "exchange": "NASDAQ", "from": "2024-02-01", "to": "2024-03-01", "apikey": FMP_KEY},
timeout=15,
)
resp.raise_for_status()
df = pd.DataFrame(resp.json())
# 按 date 升序重排并数值化 averageChange(平均涨跌幅)
df["averageChange"] = pd.to_numeric(df["averageChange"], errors="coerce")
df = df.sort_values("date").reset_index(drop=True)参数使用和避坑
2 组参数组合 · 2 条避坑以下列出本接口在高频投研与回测场景下的常用 Query 参数组合写法:
| 投研场景 | Query 参数组合示例 | 返回数据特征与用途 |
|---|---|---|
| 按 2025 一季度区间(from/to)查询细分行业历史表现 | industry=Biotechnology&from=2025-01-01&to=2025-03-31 | 设定 2025Q1 起止日期调用 /stable/historical-industry-performance,返回窗口内全部 industry、exchange、averageChange 共 4 列事件记录。 |
| 回溯 2024H2 日期区间(from/to)归档细分行业历史表现 | industry=Biotechnology&from=2024-07-01&to=2024-12-31 | 将日期窗口移至 2024 下半年调用 /stable/historical-industry-performance,批量回填历史截面的 industry、exchange、averageChange(样本 Biotechnology)。 |
拉取细分行业历史表现(/stable/historical-industry-performance,必填 industry)时,返回记录中的 industry(如 Biotechnology)与 exchange 默认按时间倒序排列,画图或回测前请执行升序重排。
细分行业历史表现(/stable/historical-industry-performance)包含 1 个数值列与 3 个文本/日期列,按 (date, exchange, industry) 建主键并将 averageChange(平均涨跌幅)设为双精度类型最为稳妥。
返回数据
4 个字段本接口示例响应共包含 4 个字段(数值型 1 个,文本/日期/布尔型 3 个)。下表列出全部字段名、类型、首条记录真实样本值与中文释义,实际返回会因接口与数据状态有所不同。
| 字段 | 类型 | 示例值 | 说明 |
|---|---|---|---|
date | string | "2024-03-01" | 日期 |
industry | string | "Biotechnology" | 细分行业 |
exchange | string | "NASDAQ" | 交易所代码 |
averageChange | number | 2.6143442556463383 | 平均涨跌幅 |
查看响应数据示例(原始 JSON)
[
{
"date": "2024-03-01",
"industry": "Biotechnology",
"exchange": "NASDAQ",
"averageChange": 2.6143442556463383
}
]常见问题解答(FAQ)
2 个问题细分行业历史表现(共 4 列)与 板块表现快照(共 4 列)在工程调用中怎么配合?
在参数上,细分行业历史表现(/stable/historical-industry-performance)为必填 industry,输出 industry(Biotechnology)等 4 列;Market Sector Performance Snapshot(板块表现快照)为必填 date,输出 4 列,可按需串联调用。
在多资产或长周期策略中使用细分行业历史表现(/stable/historical-industry-performance),请求参数该如何编排?
调用 /stable/historical-industry-performance 时宜指定起止日期 from/to 分段同步 /stable/historical-industry-performance;冷启动全量回填可分批执行,日常盘后则只拉最新一期 industry(细分行业)。
同模块相关接口对比
Market Performance本接口路径 /stable/historical-industry-performance,必填参数 industry。 同一模块「Market Performance」下共 4 个接口,下表列出其余 3 个, 按粒度与查询维度对比,避免选错接口。
| 接口 | 路径 | 核心差异与适用场景 |
|---|---|---|
| 板块表现快照Market Sector Performance Snapshot | /stable/sector-performance-snapshot | 按板块平均涨跌幅呈现市场各板块的表现,分析不同行业在市场中的实时表现 |
| 细分行业表现快照Industry Performance Snapshot | /stable/industry-performance-snapshot | 每日汇总各细分行业在主要交易所的平均涨跌幅,如广告代理、医疗设备、科技服务等 |
| 板块历史表现Historical Market Sector Performance | /stable/historical-sector-performance | 能源、科技、医疗健康等市场板块的历史涨跌数据,覆盖主要交易所 |