Senate Profiles参议员资料
该接口返回国会议员的资料详情:党派、所属州、职位及任职年限。
https://quote-fmp.com/stable/senate-profile数据更新周期
该接口暂无固定更新周期(多为按需更新的参考或静态数据)。
接口说明
- 过滤与分页:可按 是否在任、senateID、latestParty、latestPosition 过滤,page / limit 分页。
- senateID 是跨接口唯一键:交易、持仓、净资产接口都用它关联。不要用姓名关联 —— 存在同名议员,对照
firstName(名)与lastName(姓) 等历史记录,可检验策略信号在不同市场周期下的稳健性。 - 覆盖参众两院:latestPosition 会区分 Senator 与 Representative,不是只有参议院。
- 跨模块关联接口:House Trades By ID(众议院交易按议员ID查询) · Latest Senate Financial Disclosures(参议院最新财务披露) · Latest Insider Trading(最新内部人交易) · Institutional Ownership Filings(机构持股申报)
请求参数
6 个参数| 参数 | 类型 | 要求 | 示例 | 说明 |
|---|---|---|---|---|
active | boolean | 可选 | true | 是否仅返回处于活跃状态的记录。 |
senateID | string | 可选 | P000197 | 参议员的唯一标识,用于国会交易数据。 |
latestParty | string | 可选 | Republican | 以某主体为对象获取最新持仓记录。 |
latestPosition | string | 可选 | Representative | 获取该主体的最新持仓头寸。 |
page | number | 可选 | 0 | 分页页码,从 0 开始,配合每页条数翻页取更多数据(从 0 起算的分页游标;当响应返回空数组 [] 时代表已翻至历史末页) |
limit | number | 可选 | 500 | 返回结果条数上限,用于控制单次响应大小。 |
调用代码示例
Python 关键代码通过 /stable/senate-profile 检索参议员资料(参数:可选 active, senateID),输出 senateID(参议员 ID)、firstName(名)、lastName(姓)(示例 senateID=L000397)。
resp = requests.get(
"https://quote-fmp.com/stable/senate-profile",
params={"active": "true", "senateID": "P000197", "latestParty": "Republican", "latestPosition": "Representative", "apikey": FMP_KEY},
timeout=15,
)
resp.raise_for_status()
df = pd.DataFrame(resp.json())
# 按 birthDate 升序重排并数值化 yearsActive(任职年数)
df["yearsActive"] = pd.to_numeric(df["yearsActive"], errors="coerce")
df = df.sort_values("birthDate").reset_index(drop=True)参数使用和避坑
2 组参数组合 · 2 条避坑以下列出本接口在高频投研与回测场景下的常用 Query 参数组合写法:
| 投研场景 | Query 参数组合示例 | 返回数据特征与用途 |
|---|---|---|
| 读取参议员资料最新首屏流(page=0, limit=50) | page=0&limit=50 | 请求 /stable/senate-profile 首屏记录,获取最新披露的 senateID、firstName、lastName(样本 senateID=L000397)。 |
| 递增游标翻页回填参议员资料(page=1, limit=100) | page=1&limit=100 | 向 /stable/senate-profile 传 page=1&limit=100,向历史纵深翻页归档 senateID、firstName、lastName 等 10 列。 |
/stable/senate-profile(可选 active, senateID)返回的 senateID(参议员 ID,样本 L000397)为当前有效记录;在写入本地维表或缓存前,请先去除首尾空白字符并校验非空。
参议员资料返回的 yearsActive(任职年数,示例 31.6)在增量同步时,应按 (senateID) 覆盖更新已有记录。
返回数据
10 个字段本接口示例响应共包含 10 个字段(数值型 1 个,文本/日期/布尔型 9 个)。下表列出全部字段名、类型、首条记录真实样本值与中文释义,实际返回会因接口与数据状态有所不同。
| 字段 | 类型 | 示例值 | 说明 |
|---|---|---|---|
senateID | string | "L000397" | 参议员 ID |
firstName | string | "Zoe" | 名 |
lastName | string | "Lofgren" | 姓 |
birthDate | string | "1947-12-20" | 出生日期 |
latestParty | string | "Democrat" | 所属政党 |
latestState | string | "CA" | 所在州 |
latestPosition | string | "Representative" | 最近职位 |
image | string | "https://images.financialmodeli…" | 图片链接 |
active | boolean | true | 有效状态 |
yearsActive | number | 31.6 | 任职年数 |
查看响应数据示例(原始 JSON)
[
{
"senateID": "L000397",
"firstName": "Zoe",
"lastName": "Lofgren",
"birthDate": "1947-12-20",
"latestParty": "Democrat",
"latestState": "CA",
"latestPosition": "Representative",
"image": "https://images.financialmodelingprep.com/senate/L000397.jpg",
"active": true,
"yearsActive": 31.6
}
]常见问题解答(FAQ)
2 个问题自动化采集中如何搭配调用参议员资料(/stable/senate-profile)与同模块的 参议员任职记录?
在「Profile」模块内,参议员资料(/stable/senate-profile,可选 active, senateID)负责输出 senateID 与 firstName 等 10 项指标,Senate Positions(参议员任职记录)负责输出 8 项指标。
调用 /stable/senate-profile 采集参议员资料时,如何设计参数控制与批量请求策略?
工程上推荐在 /stable/senate-profile 中固定 limit 并从 page=0 起逐页拉取;同时复用 requests.Session() 保持 HTTP Keep-Alive,直接提取 senateID 与 firstName。
同模块相关接口对比
Profile本接口路径 /stable/senate-profile,无必填参数。 同一模块「Profile」下共 4 个接口,下表列出其余 3 个, 按粒度与查询维度对比,避免选错接口。