Skip to content
Finance
Skill

/yahoo-finance

API no oficial de Yahoo Finance: precios, históricos, fundamentales, opciones, noticias en JSON puro sin wrappers.

BOOST
From plugin
gauss314-skills
25032 skills
Install
$ npx -y skills add gauss314/skills --skill yahoo-finance --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/yahoo-finance

Context preview

The summary Claude sees to decide when to auto-load this skill.

API no oficial de Yahoo Finance: precios, históricos, fundamentales, opciones, noticias en JSON puro sin wrappers.

SKILL.md

yahoo-finance.SKILL.md
name: yahoo-finance
description: "API no oficial de Yahoo Finance: precios, históricos, fundamentales, opciones, noticias en JSON puro sin wrappers."
license: MIT

Yahoo Finance — API Directa (sin yfinance)

API no oficial de Yahoo Finance. Accedé a datos de **acciones, ETFs, crypto, forex, bonos, índices, opciones, fundamentos y noticias** mediante **requests HTTP directos** sin usar `yfinance` ni ningún wrapper.

**Base URL:** `https://query1.finance.yahoo.com` **Alternativa:** `https://query2.finance.yahoo.com`

---

⚠️ Importante

  • Yahoo **no tiene API pública oficial** desde 2017. Estos endpoints son no oficiales y pueden cambiar sin aviso.
  • Algunos endpoints requieren autenticación via **cookie + crumb** (abajo se explica).
  • El endpoint `v8/finance/chart` funciona sin autenticación (solo User-Agent de navegador).
  • Siempre implementar **rate limiting** y **manejo de errores**.

---

Documentación completa

Para referencia exhaustiva de todos los endpoints, campos, JSON structures, códigos de error, tickers internacionales, estrategias de rate limiting y ejemplos detallados, ver:

📖 **[references/API_REFERENCE.md](./references/API_REFERENCE.md)**

Ese documento incluye:

  • Los **33 módulos** de `quoteSummary` con cada campo documentado
  • JSON responses **completas** de cada endpoint
  • **Tickers internacionales** (`.BA` para Argentina, `.SA` para Brasil, etc.)
  • **WebSocket streaming**
  • **Screener**, **lookup**, **trending**
  • **Estrategias de rate limiting** con exponential backoff y rotación de User-Agent

---

Autenticación: Cookie + Crumb

Varios endpoints requieren un **crumb** (token CSRF) que se obtiene con cookies de sesión.

import requests

BASE = "https://query1.finance.yahoo.com"
HEADERS = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}

def yahoo_session():
    """Retorna requests.Session con cookie A3 y crumb."""
    s = requests.Session()
    s.headers.update(HEADERS)
    s.get("https://fc.yahoo.com", timeout=10)
    crumb = s.get(f"{BASE}/v1/test/getcrumb", timeout=10).text.strip()
    s.params = {"crumb": crumb}
    return s

# Uso:
# s = yahoo_session()
# r = s.get("https://query1.finance.yahoo.com/v7/finance/quote?symbols=AAPL,MSFT")

Endpoints según autenticación

| Sin auth (solo User-Agent) | Requieren crumb | |----------------------------|-----------------| | `v8/finance/chart` (históricos) | `v7/finance/quote` (precios) | | `v1/finance/search` (búsqueda) | `v10/finance/quoteSummary` (fundamentos) | | `v1/finance/trending` (tendencias) | `v7/finance/options` (opciones) | | `v1/finance/lookup` (lookup) | `v6/finance/recommendationsbysymbol` |

---

Endpoints — Resumen rápido

1. Históricos OHLCV — `v8/finance/chart`

GET https://query1.finance.yahoo.com/v8/finance/chart/{symbol}?range=1y&interval=1d

| Parámetro | Ejemplos | |-----------|----------| | `range` | `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `5y`, `10y`, `ytd`, `max` | | `interval` | `1m`, `5m`, `15m`, `1h`, `1d`, `1wk`, `1mo` | | `events` | `div,splits` (incluye dividendos y splits) |

import requests
headers = {"User-Agent": "Mozilla/5.0 (...) Chrome/120.0.0.0 Safari/537.36"}
r = requests.get("https://query1.finance.yahoo.com/v8/finance/chart/AAPL",
                 params={"range": "1y", "interval": "1d", "events": "div,splits"},
                 headers=headers)
data = r.json()["chart"]["result"][0]
# data["timestamp"] -> fechas Unix
# data["indicators"]["quote"][0] -> open, high, low, close, volume
# data["indicators"]["adjclose"][0] -> precios ajustados
# data["events"] -> dividendos y splits

2. Quote — `v7/finance/quote`

s = yahoo_session()
r = s.get("https://query1.finance.yahoo.com/v7/finance/quote?symbols=AAPL,MSFT,GOOGL")
quotes = r.json()["quoteResponse"]["result"]
for q in quotes:
    print(q["symbol"], q["regularMarketPrice"], q["regularMarketChangePercent"])

Campos: `regularMarketPrice`, `regularMarketChangePercent`, `marketCap`, `trailingPE`, `fiftyTwoWeekHigh/Low`, `dividendYield`, `volume`, `marketState` (PRE/REGULAR/POST/CLOSED).

3. Fundamentos — `v10/finance/quoteSummary`

s = yahoo_session()
r = s.get("https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL",
          params={"modules": "assetProfile,financialData,defaultKeyStatistics,incomeStatementHistory,balanceSheetHistory,cashflowStatementHistory,earnings,recommendationTrend"})
fundamentals = r.json()["quoteSummary"]["result"][0]
profile = fundamentals["assetProfile"]           # sector, industry, employees, description
financials = fundamentals["financialData"]        # EBITDA, revenue, margins, ROE, ROA
stats = fundamentals["defaultKeyStatistics"]      # beta, shares, PE, PEG, short info

Hay **33 módulos disponibles**. Ver lista completa en [API_REFERENCE.md sección 4](./references/API_REFERENCE.md#4-v10financequotesummary--fundamentos).

4. Opciones — `v7/finance/options`

s = yahoo_session()
r = s.get("https://query1.finance.yahoo.com/v7/finance/options/AAPL")
data = r.json()["optionChain"]["result"][0]
expirations = data["expirationDates"]
strikes = data["strikes"]
options = data["options"][0]  # calls + puts

5. Búsqueda + Noticias — `v1/finance/search`

r = requests.get("https://query1.finance.yahoo.com/v1/finance/search",
                 params={"q": "Apple", "quotesCount": 3, "newsCount": 5},
                 headers=HEADERS)
data = r.json()
# data["quotes"] -> tickers encontrados
# data["news"] -> noticias relacionadas

---

Scripts

| Script | Descripción | |--------|-------------| | **[batch_fetch.py](./scripts/batch_fetch.py)** | Batch multi-ticker con token bucket + ThreadPoolExecutor. Quote batching (todos en 1 request). Charts en paralelo respetando rate limit. | | **[fetch_all.py](./scripts/fetch_all.py)** | Script integral: fetch de histórico + quote + fundamentals + opciones + search + recomendaciones. Genérico para cualquier

Read more
Ships withgauss314-skills

Open-source collection of skills compatible with the SKILL.md standard. Developed for the AI courses at UCEMA.

Get the whole plugin

Other skills on gauss314-skills.