关于 historyofmarket
historyofmarket 是一项面向金融市场研究者和 Agent 的技能,通过公开 API 提供美国市场历史数据集。数据涵盖多个指数、ETF、估值指标、回撤和宏观序列,并附带重建历史成分股的脚本。
主要功能
- 01访问 88 个预生成 JSON 数据集
- 02覆盖美国指数、ETF 与宏观数据
- 03提供 CAPE、估值和回撤数据
- 04按历史日期重建指数成分股
- 05提供行业轮动分析脚本
适用场景
- 01研究长期市场估值与收益
- 02分析历史回撤及其触发事件
- 03重建特定日期的指数成分股
- 04比较行业收益、相关性与回撤
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ gauss314/ skills --skill historyofmarket安装后在 Claude Code 中输入/historyofmarket确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
assets/endpoints.jsonreferences/BROADER_MARKET.mdDRAWDOWN_VOLATILITY.mdMAGNIFICENT7.mdNASDAQ_100_METHODOLOGY.mdSECTOR_ETFS.mdSP500_METHODOLOGY.mdVALUATION_METRICS.mdscripts/reconstitute_ndx.pyreconstitute_sp500.pysector_rotation.py详细介绍
History of Market
用于访问公开 API historyofmarket.com 的 Skill——88 个 关于美国金融市场历史(自 1871 年起)的预生成数据集(静态 JSON)。无需 API key,无需身份验证,允许跨域资源共享(CORS),采用 CC BY 4.0 许可。
每个数据集都是一个预生成的 JSON 文件(无参数)。缓存:
max-age=300,并设置 stale-while-revalidate=3600。支持 ETag。
🎯 涵盖的数据
| 类别 | 指数 / ETF | 可用数据 |
|---|---|---|
| S&P 500 | SPX | 自 1928 年起的日度数据、1871 年起的 CAPE、EPS、回撤、波动率、VIX、成分股、变更、行业、远期 PE、ROE、驱动因素分解、回报详情 |
| Nasdaq Composite | COMP | 自 1971 年起的日度数据 |
| Nasdaq 100 | NDX | 自 1985 年起的日度数据、成分股、年度回报、回撤、VXN、远期 PE、驱动因素分解、滚动 5 年数据、变更 |
| QQQ | QQQ | 回报详情(价格 + 股息 + 回购) |
| Dow Jones | DJIA | 自 1914 年起的日度数据 |
| Philadelphia Semi | SOX | 自 1994 年起的日度数据、30 个成分股、SMH 持仓、存储器估值、SOX/SPX 比率、ETF 对比 |
| 行业 ETF | XLK、XLF | 价格、年度回报、回撤、波动率、持仓、GICS 重新分类(2018/2023) |
| Mag 7 | AAPL/MSFT/NVDA/GOOGL/AMZN/META/TSLA | 等权重综合指数、集中度、相关性、AI 估值、AI 资本支出、沿革 |
| 宏观 | — | AIAE(股票配置)、NBER 衰退、收益率曲线、按行业划分的远期 PE |
⚡ 此 Skill 的独特之处
-
自 1871 年起的 CAPE(Shiller PE)——仓库中唯一提供历史 PE10 数据的 Skill。
references/VALUATION_METRICS.md -
带原因的回撤——每次回撤都包含触发事件和恢复所需的 天数。
references/DRAWDOWN_VOLATILITY.md -
驱动因素分解——将年度回报分解为重估 (PE 变化)与修正(EPS 变化)。
references/VALUATION_METRICS.md -
GICS 重新分类——2018 年和 2023 年 GICS 行业变更对 XLK 和 XLF 的影响。
references/SECTOR_ETFS.md -
历史重构——脚本可按指定日期重构 S&P 500 和 Nasdaq 100 的 历史成分股。
🚀 快速开始
# S&P 500 — century closes
curl https://historyofmarket.com/api/sp500/century.json
# Shiller CAPE
curl https://historyofmarket.com/api/sp500/pe.json
# Drawdowns historicos con causa
curl https://historyofmarket.com/api/sp500/drawdowns.json
# Constituyentes actuales S&P 500
curl https://historyofmarket.com/api/sp500/constituents.json
# Cambios historicos S&P 500 (adds/removes)
curl https://historyofmarket.com/api/sp500/changes.json
# Nasdaq 100 constituyentes actuales
curl https://historyofmarket.com/api/nasdaq/100.json
# Mag 7 concentracion en S&P 500
curl https://historyofmarket.com/api/mag7/concentration.json
# NBER recessions
curl https://historyofmarket.com/api/recessions.json
📁 文件目录
skills/historyofmarket/
├── SKILL.md
├── assets/
│ └── endpoints.json ← snapshot de todos los 88 endpoints
├── references/
│ ├── SP500_METHODOLOGY.md ← S&P 500: elegibilidad, earnings test, cambios
│ ├── NASDAQ_100_METHODOLOGY.md
│ ├── DRAWDOWN_VOLATILITY.md
│ ├── VALUATION_METRICS.md ← CAPE, forward PE, driver decomp, ROE
│ ├── SECTOR_ETFS.md ← XLK, XLF, GICS reclass, holdings
│ ├── MAGNIFICENT7.md ← Mag 7, concentration, AI capex, lineage
│ └── BROADER_MARKET.md ← Dow, SOX, recessions, yield curve
└── scripts/
├── reconstitute_sp500.py ← reconstruir miembros S&P 500 a fecha dada
├── reconstitute_ndx.py ← reconstruir miembros NDX a fecha dada
└── sector_rotation.py ← rotacion sectorial XLK vs XLF vs SPY
📚 参考资料
如需了解数据背后的理论:
| 文档 | 内容 |
|---|---|
references/SP500_METHODOLOGY.md | 资格条件、盈利测试、最低市值、指数委员会、变更历史 |
references/NASDAQ_100_METHODOLOGY.md | Nasdaq 100 方法、年度重新构成、权重上限 |
references/DRAWDOWN_VOLATILITY.md | 回撤、年内与年末数据对比、已实现波动率、VIX/VXN |
references/VALUATION_METRICS.md | Shiller CAPE、远期 PE、滚动 PE、EPS、ROE、驱动因素分解 |
references/SECTOR_ETFS.md | 行业 ETF XLK/XLF、GICS 重新分类(2018/2023)、持仓 |
references/MAGNIFICENT7.md | Mag 7 综合指数、在 SPX 中的集中度、相关性、AI 资本支出、沿革 |
references/BROADER_MARKET.md | Dow Jones、SOX/SMH、NBER 衰退、收益率曲线 |
🐍 脚本
| 脚本 | 用途 | 用法 |
|---|---|---|
scripts/reconstitute_sp500.py | 重构历史指定日期的 S&P 500 成分股(共 500 只) | py scripts/reconstitute_sp500.py 2020-01-01 |
scripts/reconstitute_ndx.py | 重构历史指定日期的 Nasdaq 100 成分股(共 100 只) | py scripts/reconstitute_ndx.py 2020-01-01 |
scripts/sector_rotation.py | 分析行业轮动:滚动回报、相关性、同步回撤 | py scripts/sector_rotation.py |
🌐 入口
| 端点 | 描述 |
|---|---|
/api/_manifest.json | 88 个数据集的完整目录 |
/api/profile.json | 面向 AI Agent 的站点资料 |
/api/tools.json | 可供机器调用的 68 个工具列表 |
/llms.txt | 适合大模型阅读的摘要 |
/.well-known/llms.txt | 众所周知的位置 |
/ai.txt | AI Agent 指令 |
/sitemap.xml | 完整站点地图(60 多个面板 × 6 种语言) |
/robots.txt | Robots.txt |
完整的 88 个端点及其描述快照,请参阅 assets/endpoints.json。