google-finance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Finance — Data via API Interna sin Auth
Google Finance — 无需认证的内部API数据获取
Skill para extraer datos de Google Finance
via su endpoint RPC interno descubierto por reverse
engineering — sin API key, sin autenticacion.
batchexecuteCubre quote, OHLC historico (intraday 1-min / 5-min / daily / 6-meses),
financials masivos, earnings, analyst recommendations con opinions
individuales (Goldman, etc), descripcion empresa con address+employees,
peers, news (con thumbnails), indices globales (Dow/S&P/NASDAQ/VIX/DAX/FTSE/Nikkei)
y sectors heatmap.
本Skill用于通过逆向工程发现的**内部RPC端点**提取Google Finance数据——无需API密钥,无需认证。
batchexecute支持报价、历史OHLC数据(1分钟/5分钟日内数据 / 日线数据 / 6个月数据)、海量财务数据、收益数据、含分析师个人观点(如高盛等)的推荐信息、含地址及员工数的公司描述、同行股票、带缩略图的新闻、全球指数(道琼斯/标普/纳斯达克/VIX/DAX/富时/日经)以及板块热力图。
⚠️ WARNINGS CRITICOS — LEER PRIMERO
⚠️ 重要警告 — 请先阅读
Antes de usar este skill en cualquier escenario productivo, leer obligatoriamente.references/LIMITATIONS_TROUBLESHOOTING.md
在任何生产场景中使用本Skill前,必须阅读。references/LIMITATIONS_TROUBLESHOOTING.md
TL;DR de los 4 warnings principales
四大核心警告概述
- 🚨 API NO oficial — Google puede renombrar RPCs, cambiar layouts, agregar auth o cerrar el endpoint sin aviso.
- 🚨 Layouts SIN keys — Los responses son arrays posicionales. Si Google reordena campos, vas a leer mal sin error visible.
- 🚨 Rate limiting muy agresivo — > 5 req/s puede bloquear tu IP por horas. Recomendado: sleep ≥ 0.5s entre requests.
- 🚨 Sin warranty de continuidad — Si construis algo importante, tener fallback con otro provider (Yahoo Finance, TradingView, Finnhub).
- 🚨 非官方API — Google可能会重命名RPC接口、修改数据结构、添加认证要求或无预警关闭端点。
- 🚨 无键数据结构 — 返回结果为位置数组。若Google调整字段顺序,你可能会读取错误数据但无明显报错。
- 🚨 严格的速率限制 — 请求频率超过5次/秒可能导致你的IP被封禁数小时。建议:请求间隔至少休眠0.5秒。
- 🚨 无持续可用性保证 — 若基于本Skill构建重要系统,请准备好备用数据源(如Yahoo Finance、TradingView、Finnhub)。
Cuando NO usar este skill
请勿使用本Skill的场景
- Trading en produccion con decisiones criticas (usar feeds oficiales).
- Aplicaciones publicas que sirvan los datos a usuarios.
- Volumen > 10k requests/dia (riesgo de bloqueo permanente de IP).
- Redistribuir los datos como propios (terminos de uso de Google).
- 涉及关键决策的生产环境交易(请使用官方数据馈送)。
- 向用户提供数据的公开应用。
- 日请求量超过10000次(存在IP永久封禁风险)。
- 重新分发数据并声称是自有数据(违反Google服务条款)。
Cuando SI usar este skill
适合使用本Skill的场景
- Investigacion personal y prototipos.
- Backtest con cache local.
- Analisis comparativo cruzado con otros providers.
- Casos donde los datos UNICOS de Google son criticos (intraday 1-min gratis, detalle individual de analyst opinions).
- 个人研究与原型开发。
- 本地缓存回测。
- 与其他数据源的交叉对比分析。
- Google独有数据至关重要的场景(免费1分钟日内数据、分析师个人观点详情)。
🚀 Quick start
🚀 快速开始
bash
undefinedbash
undefinedQuote basico
基础报价
py scripts/fetch_gfinance.py quote GGAL:NASDAQ
py scripts/fetch_gfinance.py quote AAPL:NASDAQ
py scripts/fetch_gfinance.py quote GGAL:BCBA # mercado argentino
py scripts/fetch_gfinance.py quote GGAL:NASDAQ
py scripts/fetch_gfinance.py quote AAPL:NASDAQ
py scripts/fetch_gfinance.py quote GGAL:BCBA # 阿根廷市场
Intraday del dia actual
当日日内数据
py scripts/fetch_gfinance.py intraday-5min AAPL:NASDAQ
py scripts/fetch_gfinance.py intraday-1min GGAL:NASDAQ
py scripts/fetch_gfinance.py intraday-5min AAPL:NASDAQ
py scripts/fetch_gfinance.py intraday-1min GGAL:NASDAQ
Daily historico
历史日线数据
py scripts/fetch_gfinance.py daily-6m AAPL:NASDAQ
py scripts/fetch_gfinance.py daily-6m AAPL:NASDAQ
Indices globales (Dow, S&P, NASDAQ, VIX, DAX, FTSE, Nikkei...)
全球指数(道琼斯、标普、纳斯达克、VIX、DAX、富时、日经...)
py scripts/fetch_gfinance.py indices
py scripts/fetch_gfinance.py indices
Analyst recommendations + opinions individuales
分析师推荐及个人观点
py scripts/fetch_gfinance.py analysts NVDA:NASDAQ
py scripts/fetch_gfinance.py analysts NVDA:NASDAQ
Todo en uno (6 requests pipelinadas)
一站式获取(6个请求流水线执行)
py scripts/fetch_gfinance.py all GGAL:NASDAQ
---py scripts/fetch_gfinance.py all GGAL:NASDAQ
---Estructura del skill
Skill结构
skills/google-finance/
├── SKILL.md # Este archivo
├── references/ # 5 documentos
│ ├── REFERENCE.md # Overview general + batchexecute
│ ├── RPC_IDS.md # Catalogo de los 14+ RPC IDs
│ ├── RESPONSE_FORMAT.md # Parser deep dive del wrb.fr protocol
│ ├── LIMITATIONS_TROUBLESHOOTING.md # ⚠️ Warnings, plan B, debugging
│ └── COOKBOOK.md # 25 recetas listas
├── assets/ # 3 archivos JSON
│ ├── rpc_ids.json # Catalogo estructurado de RPCs + args
│ ├── chunk_layouts.json # Layouts posicionales de los arrays
│ └── consent_cookies.json # Cookies de bypass del consent
└── scripts/
└── fetch_gfinance.py # Script principal — 19 modos CLIskills/google-finance/
├── SKILL.md # 本文档
├── references/ # 5份文档
│ ├── REFERENCE.md # 概览 + batchexecute详解
│ ├── RPC_IDS.md # 14+个RPC ID目录
│ ├── RESPONSE_FORMAT.md # wrb.fr协议解析深度剖析
│ ├── LIMITATIONS_TROUBLESHOOTING.md # ⚠️ 警告、备选方案、调试指南
│ └── COOKBOOK.md # 25个现成使用示例
├── assets/ # 3个JSON文件
│ ├── rpc_ids.json # 带参数模板及描述的RPC结构化目录
│ ├── chunk_layouts.json # 数组位置结构定义
│ └── consent_cookies.json # 绕过同意弹窗的Cookie
└── scripts/
└── fetch_gfinance.py # 主脚本 — 19种CLI模式19 modos CLI disponibles
19种可用CLI模式
Por simbolo
按股票代码
| Modo | Data | RPC ID |
|---|---|---|
| Precio + change + currency + market hours | |
| Quote + industry + market cap + volume | |
| Descripcion + address + employees + ratios + URLs | |
| Related stocks (default 4, controlable con | |
| Recommendations summary + opinions individuales | |
| Earnings history multi-period | |
| Ratings tecnicos (similar a TradingView Recommend.*) | |
| Income + balance + cashflow ~22 KB multi-period | |
| OHLC 1-min del dia actual (~30 KB) | |
| OHLC 5-min con OHLC completo (~5 KB) | |
| OHLC diario ultimo mes (~22 dias) | |
| OHLC diario ultimos ~6 meses | |
| News especificas del simbolo | |
| News globales (con related symbols del query) | |
| 模式 | 数据内容 | RPC ID |
|---|---|---|
| 价格 + 涨跌幅 + 货币 + 交易时段 | |
| 报价 + 行业 + 市值 + 成交量 | |
| 公司描述 + 地址 + 员工数 + 比率 + 网址 | |
| 相关股票(默认4只,可通过 | |
| 推荐汇总 + 分析师个人观点 | |
| 多周期收益历史 | |
| 技术评级(类似TradingView的推荐评级) | |
| 利润表 + 资产负债表 + 现金流量表 多周期数据(约22KB) | |
| 当日1分钟OHLC数据(约30KB) | |
| 完整5分钟OHLC数据(约5KB) | |
| 最近一个月日线OHLC数据(约22个交易日) | |
| 最近约6个月日线OHLC数据 | |
| 股票代码相关新闻 | |
| 全球新闻(含查询相关股票代码) | |
Globales (sin simbolo)
全局模式(无需股票代码)
| Modo | Data | RPC ID |
|---|---|---|
| Indices globales: Dow, S&P, NASDAQ, VIX, DAX, FTSE, Nikkei, etc | |
| Sectors equity heatmap (Health Care, Tech, etc) | |
| 模式 | 数据内容 | RPC ID |
|---|---|---|
| 全球指数:道琼斯、标普、纳斯达克、VIX、DAX、富时、日经等 | |
| 股票板块热力图(医疗、科技等) | |
Catalogos locales (sin HTTP)
本地目录(无需HTTP请求)
| Modo | Data |
|---|---|
| Catalogo de RPC IDs con args templates y descripciones |
| Layouts posicionales de los arrays anidados |
| Cookies de bypass del consent screen |
| 模式 | 数据内容 |
|---|---|
| 带参数模板及描述的RPC ID目录 |
| 嵌套数组的位置结构定义 |
| 绕过同意弹窗的Cookie |
Combinado
组合模式
| Modo | Data |
|---|---|
| quote + description + analysts + financials + daily + news (6 requests) |
| 模式 | 数据内容 |
|---|---|
| 报价 + 公司描述 + 分析师推荐 + 财务数据 + 日线数据 + 新闻(6个请求) |
Formato de simbolos
股票代码格式
| Donde | Formato | Ejemplos |
|---|---|---|
| Tickers US | | |
| ADRs argentinas | | |
| Tickers BCBA (locales argentinas) | | |
| Brazil B3 | | |
| Spain BME | | |
| Germany Xetra | | |
| Indices | | |
El script tambien acepta el orden invertido () — auto-detecta cual es el exchange. Pero el formato canonical de Google esNASDAQ:GGAL.TICKER:EXCHANGE
| 市场 | 格式 | 示例 |
|---|---|---|
| 美国股票代码 | | |
| 阿根廷ADR | | |
| 阿根廷BCBA本地股票代码 | | |
| 巴西B3 | | |
| 西班牙BME | | |
| 德国Xetra | | |
| 指数 | | |
脚本也接受反转格式()——会自动识别交易所。但Google的标准格式为NASDAQ:GGAL。TICKER:EXCHANGE
Diferenciales unicos vs otros skills del repo
与仓库中其他Skill的独特差异
| Feature | Google Finance | TradingView | Yahoo | Finnhub |
|---|---|---|---|---|
| Sin auth | ✅ | ✅ | ✅ | Freemium |
| OHLC intraday 1-min publico gratis | ✅ UNICO | ❌ (paid) | ⚠️ limited | ⚠️ paid |
| OHLC 5-min completo | ✅ | ❌ | ⚠️ | ⚠️ |
| Indices globales en 1 call (Dow+S&P+NASDAQ+VIX+DAX+FTSE+Nikkei...) | ✅ UNICO | ⚠️ uno por uno | ⚠️ | ⚠️ |
| Detalle individual de analyst opinions (nombre, firm, target, fecha) | ✅ UNICO | ⚠️ solo agregado | ⚠️ | ✅ |
| Sectors heatmap | ✅ | ⚠️ | ❌ | ❌ |
| Descripcion empresa con address fisico + employees | ✅ UNICO | ⚠️ | ⚠️ | ✅ |
| Quote delayed | ✅ | ✅ | ✅ | ✅ |
| Financials | ✅ (~22 KB) | ✅ | ✅ | ✅ |
| News con thumbnails | ✅ | ✅ | ✅ | ✅ |
| 功能 | Google Finance | TradingView | Yahoo | Finnhub |
|---|---|---|---|---|
| 无需认证 | ✅ | ✅ | ✅ | 免费增值 |
| 免费公开的1分钟日内OHLC数据 | ✅ 独有 | ❌(付费) | ⚠️ 受限 | ⚠️ 付费 |
| 完整5分钟OHLC数据 | ✅ | ❌ | ⚠️ | ⚠️ |
| 单次请求获取全球指数(道琼斯+标普+纳斯达克+VIX+DAX+富时+日经...) | ✅ 独有 | ⚠️ 单次一个 | ⚠️ | ⚠️ |
| 分析师个人观点详情(姓名、机构、目标价、日期) | ✅ 独有 | ⚠️ 仅汇总 | ⚠️ | ✅ |
| 板块热力图 | ✅ | ⚠️ | ❌ | ❌ |
| 含实体地址及员工数的公司描述 | ✅ 独有 | ⚠️ | ⚠️ | ✅ |
| 延迟报价 | ✅ | ✅ | ✅ | ✅ |
| 财务数据 | ✅(约22KB) | ✅ | ✅ | ✅ |
| 带缩略图的新闻 | ✅ | ✅ | ✅ | ✅ |
Cuando usar Google Finance > TradingView
何时优先使用Google Finance而非TradingView
- Necesitas OHLC intraday 1-min sin pagar.
- Necesitas detalle individual de opinions por analista con firma/target/fecha.
- Necesitas el address fisico de una empresa argentina.
- Necesitas indices globales (Dow+S&P+NASDAQ+VIX+DAX+FTSE+Nikkei) en una sola call.
- 你需要免费的1分钟日内OHLC数据。
- 你需要含机构、目标价、日期的分析师个人观点详情。
- 你需要阿根廷公司的实体地址。
- 你需要单次请求获取全球指数(道琼斯+标普+纳斯达克+VIX+DAX+富时+日经)。
Cuando usar TradingView > Google Finance
何时优先使用TradingView而非Google Finance
- Necesitas screener masivo con filtros tipo SQL.
- Necesitas ISIN/CUSIP/CIK del simbolo (Symbol Search v3).
- Necesitas indicadores tecnicos pre-calculados (RSI/MACD/EMAs/pivots).
- Necesitas robustez — TV es mucho mas estable que Google Finance.
- 你需要支持类SQL筛选的大规模股票筛选器。
- 你需要股票代码的ISIN/CUSIP/CIK(Symbol Search v3)。
- 你需要预计算的技术指标(RSI/MACD/EMA/枢轴点)。
- 你需要更高的稳定性——TradingView比Google Finance稳定得多。
Consideraciones tecnicas
技术说明
Endpoint
端点
POST https://www.google.com/finance/beta/_/FinHubUi/data/batchexecute?rpcids={RPC_ID}POST https://www.google.com/finance/beta/_/FinHubUi/data/batchexecute?rpcids={RPC_ID}Headers requeridos
必填请求头
Ya configurados en el script:
python
HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"X-Same-Domain": "1", # CRITICO
"Origin": "https://www.google.com",
"Referer": "https://www.google.com/finance/...",
}脚本已配置好以下请求头:
python
HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"X-Same-Domain": "1", # 关键
"Origin": "https://www.google.com",
"Referer": "https://www.google.com/finance/...",
}Cookies de bypass
绕过同意弹窗的Cookie
El script las pasa automaticamente:
python
COOKIES = {
"CONSENT": "PENDING+999",
"SOCS": "CAESHAgBEhJnd3NfMjAyNTAxMjMtMF9SQzMaAmVuIAEaBgiAvLW8Bg",
}Si dejan de funcionar, ver LIMITATIONS_TROUBLESHOOTING.md seccion 6
para capturar cookies frescas.
脚本会自动传递以下Cookie:
python
COOKIES = {
"CONSENT": "PENDING+999",
"SOCS": "CAESHAgBEhJnd3NfMjAyNTAxMjMtMF9SQzMaAmVuIAEaBgiAvLW8Bg",
}若Cookie失效,请查看LIMITATIONS_TROUBLESHOOTING.md第6节获取最新Cookie。
Response format (wrb.fr)
返回格式(wrb.fr)
Los responses usan el protocolo wrb.fr de Google (XSSI prefix + JSON
serializado doble). El script tiene un que lo maneja.
Detalles en RESPONSE_FORMAT.md.
parse_wrbfr()返回结果采用Google的wrb.fr协议(XSSI前缀 + 双重JSON序列化)。脚本包含函数处理该格式。详情请见RESPONSE_FORMAT.md。
parse_wrbfr()Rate limiting
速率限制
⚠️ Aggressive. Recomendado:
- Sleep ≥ 0.5s entre requests.
- < 1k requests/dia para no triggear bloqueo IP.
- NO usar desde CI sin precauciones (cloud IPs en blacklist).
⚠️ 限制严格。建议:
- 请求间隔至少休眠0.5秒。
- 日请求量少于1000次,避免触发IP封禁。
- 不要在CI环境中使用,除非采取预防措施(云IP可能在黑名单中)。
Output
输出
- Por defecto: JSON al stdout.
- : guarda a archivo (UTF-8,
-o archivo.json).ensure_ascii=False - : modo silencioso (sin logs INFO).
-q - : retorna response raw sin extraer del array wrb.fr.
--raw
- 默认:输出JSON到标准输出。
- : 保存到文件(UTF-8编码,
-o archivo.json)。ensure_ascii=False - : 静默模式(无INFO日志)。
-q - : 返回原始wrb.fr数组响应,不进行提取处理。
--raw
Manejo de errores
错误处理
El script captura y muestra el body para debugging.
Si el endpoint deja de funcionar, te apunta a .
requests.HTTPErrorLIMITATIONS_TROUBLESHOOTING.md脚本会捕获并显示响应体用于调试。若端点失效,会引导你查看。
requests.HTTPErrorLIMITATIONS_TROUBLESHOOTING.mdCasos comunes — recetas rapidas
常见场景 — 快速示例
25 recetas completas en COOKBOOK.md.
bash
undefined完整的25个示例请见COOKBOOK.md。
bash
undefinedQuote rapido
快速获取报价
py scripts/fetch_gfinance.py quote GGAL:NASDAQ -q
py scripts/fetch_gfinance.py quote GGAL:NASDAQ -q
Stock argentino BCBA
阿根廷BCBA本地股票
py scripts/fetch_gfinance.py quote GGAL:BCBA -q
py scripts/fetch_gfinance.py quote GGAL:BCBA -q
Indices globales del dia
当日全球指数
py scripts/fetch_gfinance.py indices -q
py scripts/fetch_gfinance.py indices -q
Intraday 5-min con OHLC completo
完整5分钟日内OHLC数据
py scripts/fetch_gfinance.py intraday-5min AAPL:NASDAQ -o aapl_5min.json
py scripts/fetch_gfinance.py intraday-5min AAPL:NASDAQ -o aapl_5min.json
Daily ultimos 6 meses
最近6个月日线数据
py scripts/fetch_gfinance.py daily-6m AAPL:NASDAQ -o aapl_6m.json
py scripts/fetch_gfinance.py daily-6m AAPL:NASDAQ -o aapl_6m.json
Analyst recommendations + opinions individuales
分析师推荐及个人观点
py scripts/fetch_gfinance.py analysts NVDA:NASDAQ -q
py scripts/fetch_gfinance.py analysts NVDA:NASDAQ -q
Comparar empresa con peers
对比公司与同行股票
py scripts/fetch_gfinance.py peers GGAL:NASDAQ --peers-count 5 -q
py scripts/fetch_gfinance.py peers GGAL:NASDAQ --peers-count 5 -q
Todo-en-uno (snapshot completo)
一站式获取(完整快照)
py scripts/fetch_gfinance.py all GGAL:NASDAQ -o ggal_complete.json
---py scripts/fetch_gfinance.py all GGAL:NASDAQ -o ggal_complete.json
---Documentacion completa
完整文档
| Documento | Contenido |
|---|---|
| Overview general + batchexecute deep dive |
| Catalogo detallado de los 14+ RPC IDs con args + outputs |
| Parser deep dive del wrb.fr (XSSI, doble JSON, edge cases) |
| ⚠️ Warnings, debugging, plan B con providers alternativos |
| 25 recetas listas para copy-paste |
| Catalogo de RPCs con args templates y descripciones |
| Layouts posicionales de cada array (que indice = que campo) |
| Cookies de bypass del consent screen |
| 文档 | 内容 |
|---|---|
| 概览 + batchexecute深度剖析 |
| 14+个RPC ID的详细目录,含参数及输出说明 |
| wrb.fr协议解析深度剖析(XSSI、双重JSON、边缘情况) |
| ⚠️ 警告、调试指南、备选数据源方案 |
| 25个可直接复制使用的示例 |
| 带参数模板及描述的RPC结构化目录 |
| 每个数组的位置结构定义(索引对应字段) |
| 绕过同意弹窗的Cookie |
Inspiracion y atribuciones
灵感与致谢
Este skill fue construido a partir de research del HTML de
, identificando los chunks
con su sistema "Wiz" (mismo que usa Search, Maps,
Translate). El protocolo wrb.fr es publico y bien documentado por la
comunidad (no por Google).
google.com/finance/beta/quote/GGAL:NASDAQAF_initDataCallbackImplementaciones similares en otros lenguajes:
- (Node.js) — usa el mismo endpoint
google-finance-quotes - (Python, distinto enfoque)
mfinance - Multiples proyectos OSS de scraping de finance.google.com
Este skill se distingue por:
- 24 modos CLI sobre 14+ RPC IDs distintos.
- Documentacion exhaustiva de los warnings y plan B.
- Catalogo estructurado de RPCs + layouts posicionales en assets.
- Parser robusto del wrb.fr con manejo de todos los edge cases.
本Skill基于对页面HTML的研究构建,识别出使用Wiz系统(与搜索、地图、翻译相同)的代码块。wrb.fr协议由社区公开记录(非Google官方)。
google.com/finance/beta/quote/GGAL:NASDAQAF_initDataCallback其他语言的类似实现:
- (Node.js)——使用同一端点
google-finance-quotes - (Python,不同实现方式)
mfinance - 多个开源的finance.google.com爬取项目
本Skill的独特之处:
- 基于14+个不同RPC ID的24种CLI模式。
- 详尽的警告及备选方案文档。
- 结构化的RPC及位置目录存储在assets中。
- 健壮的wrb.fr解析器,处理所有边缘情况。