Yahoo Finance 机构持仓 API
POST
接口健康状态
- 24h 健康值
- 正常
- 24h 平均耗时
- —
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
正常
24 小时趋势
30 天趋势
机构持仓:返回单个对象;主要字段 symbol、institutional_ownership_pct、shares_outstanding、holdings_value_usd、holders、shares_held。
单价 $8 / 千次(每次 $0.008),失败与空结果不扣费。 同步返回;慢任务可在请求体加 "mode": "async",先拿 job_id 再轮询。
AI 提示词
请帮我用 EveryInfra 的「Yahoo Finance 机构持仓」接口(yahoo_finance/institutional_holdings)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 yahoo_finance,action 填 institutional_holdings,参数放在 params 里。
- 必填参数:
- keyword:要查机构持仓的美股代码,例如 NVDA(可带 $);不收公司名。返回机构持股比例、增减持统计和持仓最多的机构;代码查不到不扣费。
- 返回一个对象,主要字段:symbol(股票代码)、institutional_ownership_pct(机构持股占总股本的百分比(inst…)、shares_outstanding(总股本)、holdings_value_usd(全部机构持仓的总市值)、holders(持有这只股票的机构数(instit…)、shares_held(全部机构合计持股数(institu…)、increased_holders(上一报告期增持的机构数(insti…)、increased_shares(增持机构合计增持的股数(insti…)、decreased_holders(上一报告期减持的机构数(insti…)、decreased_shares(减持机构合计减持的股数(insti…)、unchanged_holders(持仓不变的机构数(institut…)、unchanged_shares(持仓不变的机构合计持股数(inst…);一共 17 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=yahoo_finance。
- 示例请求体:
{
"platform": "yahoo_finance",
"action": "institutional_holdings",
"params": {
"keyword": "AAPL"
}
}
- 计费:$8 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。
写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。请求参数
| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
Authorization | header | string | 是 | - | Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。 |
platform | body | string | 是 | yahoo_finance | 平台标识,固定值。 |
action | body | string | 是 | institutional_holdings | 能力标识,固定值。 |
keyword | body.params | string | 是 | - | 要查机构持仓的美股代码,例如 NVDA(可带 $);不收公司名。返回机构持股比例、增减持统计和持仓最多的机构;代码查不到不扣费。 |
代码示例
bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "yahoo_finance",
"action": "institutional_holdings",
"params": {
"keyword": "AAPL"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
响应示例
字段预览
这组示例参数还没有真实样例:这里只按接口定义列出响应结构和字段,值用 … 占位,不是一次真实调用的结果。
json
{
"id": "req_…",
"platform": "yahoo_finance",
"action": "institutional_holdings",
"results": {
"symbol": …,
"institutional_ownership_pct": …,
"shares_outstanding": …,
"holdings_value_usd": …,
"holders": …,
"shares_held": …,
"increased_holders": …,
"increased_shares": …,
"decreased_holders": …,
"decreased_shares": …,
"unchanged_holders": …,
"unchanged_shares": …,
"new_holders": …,
"new_shares": …,
"sold_out_holders": …,
"sold_out_shares": …,
"top_holders": …,
"platform": …
},
"billing": {
"charged": …,
"charged_usd": …,
"balance_after_usd": …,
…
},
"quota": { … }
}返回字段
业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被补造。
| 字段 | 含义 |
|---|---|
symbol | 股票代码。 |
institutional_ownership_pct | 机构持股占总股本的百分比(institutional_holdings),76.59 表示 76.59%。 |
shares_outstanding | 总股本,股数(institutional_holdings)。 |
holdings_value_usd | 全部机构持仓的总市值,美元(institutional_holdings)。 |
holders | 持有这只股票的机构数(institutional_holdings)。 |
shares_held | 全部机构合计持股数(institutional_holdings)。 |
increased_holders | 上一报告期增持的机构数(institutional_holdings);increased_shares 是它们合计增持的股数。 |
increased_shares | 增持机构合计增持的股数(institutional_holdings)。 |
decreased_holders | 上一报告期减持的机构数(institutional_holdings);decreased_shares 是它们合计减持的股数。 |
decreased_shares | 减持机构合计减持的股数(institutional_holdings)。 |
unchanged_holders | 持仓不变的机构数(institutional_holdings);unchanged_shares 是它们的合计持股。 |
unchanged_shares | 持仓不变的机构合计持股数(institutional_holdings)。 |
new_holders | 新建仓的机构数(institutional_holdings);new_shares 是新建仓的股数。 |
new_shares | 新建仓的股数合计(institutional_holdings)。 |
sold_out_holders | 清仓的机构数(institutional_holdings);sold_out_shares 是清仓的股数。 |
sold_out_shares | 清仓的股数合计(institutional_holdings)。 |
top_holders | 按持仓市值从大到小的机构(institutional_holdings):name、reported_at(持仓报告日期 YYYY-MM-DD)、shares(持股数)、change_shares(比上期变动股数,减持为负)、change_pct(变动百分比)、value_usd(持仓市值,美元)。 |
platform | 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。 |
错误与计费
- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。