ワンクリックで
macrotrends
Scraper de Macrotrends: financial statements, ratios, employee count con 15+ años de data histórica. Sin API key.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scraper de Macrotrends: financial statements, ratios, employee count con 15+ años de data histórica. Sin API key.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
History of Market (historyofmarket.com) — API publica con 88 datasets historicos de indices US desde 1871. S&P 500 (price, CAPE, EPS, drawdowns, changes, constituents), Nasdaq Composite/Nasdaq 100 (price, volatility, VXN, changes), Dow Jones, SOX/SMH, sector ETFs (XLK, XLF), Magnificent 7 y macro. Sin API key, CORS libre, CC BY 4.0.
API no oficial de Yahoo Finance: precios, históricos, fundamentales, opciones, noticias en JSON puro sin wrappers.
Construcción y optimización cuantitativa de portafolios: Markowitz (scipy.optimize + Monte Carlo), Black-Litterman (prior CAPM, views absolutas/relativas, posterior bayesiano), HRP/HERC/NCO (clustering jerárquico, risk parity, NCO con restricciones). Todo flat numpy + scipy, sin Riskfolio-Lib ni PyPortfolioOpt.
Trading API de Primary (Matba ROFEX): futuros, opciones, acciones, bonos. Órdenes, posiciones, cuenta, market data.
Academic backtesting framework for quantitative research. ~30 risk and performance ratios, 10 classes of indicators, event-driven engine with 6+ strategies, MPT optimizer, forward-looking simulation with Johnson SU + t-Copula, walk-forward CV, stress testing, fundamental analysis (Altman Z, Piotroski, DuPont). All flat Python + numpy.
Pricing completo de opciones europeas y americanas. 9 metodos: Black-Scholes, Binomial CRR, Trinomial, Monte Carlo (antithetic) + Longstaff-Schwartz, Bjerksund-Stensland 2002 / BAW (American closed-form), Heston 1993 (vol estocastica, sonrisa via Fourier), Bates 1996 (Heston + Merton jumps, crash risk), greeks (BS), implied vol, P(ITM) y P(Profit). Disenado para backtesting: cada funcion es flat Python vectorizado con numpy (sin abstracciones), usa math.erfc (no scipy). BS 2.4 us/op, BS2 3.6 us, Heston 400 us, Binomial N=500 5.6 ms. CLI con 15 modos mas validate y bench. Time complexity O(1) para todos los closed-form.
| name | macrotrends |
| description | Scraper de Macrotrends: financial statements, ratios, employee count con 15+ años de data histórica. Sin API key. |
| license | MIT |
Scraper de Macrotrends que extrae datos financieros históricos: income statements, balance sheets, cash flow statements, financial ratios y employee count con hasta 15+ años de data para ~6,500 tickers de mercados US (NYSE, NASDAQ, AMEX), incluyendo ADRs internacionales de +30 países.
Los datos vienen en JSON embebido en la página (no requiere API key, solo requests + BeautifulSoup).
pip install requests beautifulsoup4
| Script | Descripción |
|---|---|
| fetch_financials.py | Script principal: statements, ratios, employees |
# Income statement anual
python scripts/fetch_financials.py --ticker NVDA --income
# Todo lo disponible (income + balance + cashflow + ratios + employees)
python scripts/fetch_financials.py --ticker AAPL --all
# Statements trimestrales
python scripts/fetch_financials.py --ticker MSFT --income --quarterly
python scripts/fetch_financials.py --ticker MSFT --balance --quarterly
# Ratios anuales o trimestrales
python scripts/fetch_financials.py --ticker NVDA --ratios
python scripts/fetch_financials.py --ticker GGAL --ratios --quarterly
# Employee count
python scripts/fetch_financials.py --ticker NVDA --employees
# Output a archivo JSON
python scripts/fetch_financials.py --ticker AAPL --all --output data.json
# Silencioso (solo JSON)
python scripts/fetch_financials.py --ticker NVDA --all --quiet
| Flag | Data | Frecuencias | Períodos |
|---|---|---|---|
--income | Income Statement | Anual, Trimestral | ~15 años / ~60 quarters |
--balance | Balance Sheet | Anual, Trimestral | ~15 años / ~60 quarters |
--cashflow | Cash Flow | Solo anual | ~15 años |
--ratios | Financial Ratios (20 ratios) | Anual, Trimestral | ~15 años / ~60 quarters |
--employees | Employee Count | Anual | ~15 años |
--all | Todos los anteriores | Según --quarterly | - |
| Flag | Descripción |
|---|---|
--quarterly | Usa frecuencia trimestral (donde esté disponible) |
--output | Archivo JSON de salida (default: stdout) |
--slug | Slug manual (si el search no funciona) |
--delay | Delay entre requests (default: 3.0s) |
--quiet | Modo silencioso |
Macrotrends usa URLs con el formato /stocks/charts/{TICKER}/{SLUG}/financial-statements.
El slug se resuelve automáticamente via el search endpoint interno. Ejemplos:
| Ticker | Slug |
|---|---|
| AAPL | apple |
| NVDA | nvidia |
| MSFT | microsoft |
| GGAL | grupo-financiero-galicia-sa |
| TSLA | tesla |
Si el search falla, se puede pasar el slug manualmente:
python scripts/fetch_financials.py --ticker GGAL --slug grupo-financiero-galicia-sa --all
Revenue, COGS, Gross Profit, R&D, SG&A, Operating Income, Net Income, EBITDA, EBIT, EPS, Shares Outstanding, etc.
Cash, Receivables, Inventory, Total Assets, Total Liabilities, Shareholders Equity, Debt, Retained Earnings, etc.
Net Income, Depreciation, Working Capital Changes, Capex, Free Cash Flow, Dividends, Stock Repurchases, etc.
Current Ratio, Debt/Equity, Gross/Operating/Net Margins, ROE, ROA, ROI, Book Value/Share, FCF/Share, etc.
Año a año, empleados totales.
Ver referencia completa de campos en references/STATEMENTS_REFERENCE.md.
Macrotrends cubre ~6,500 tickers que cotizan en NYSE, NASDAQ y AMEX (incluyendo ADRs).
| Tipo | Cantidad | Ejemplos |
|---|---|---|
| US Common Stocks | ~5,300 | AAPL, NVDA, MSFT |
| ADRs Internacionales | ~276+ | GGAL (Argentina), BABA (China), TM (Japón), PBR (Brasil), SAN (España), BP (UK) |
| ETFs & Fondos | ~91 | SPY, QQQ, VTI |
| Class A/B Shares | ~22 | BRK.A, BRK.B |
Ver detalle completo de mercados, ADRs por país y cómo buscar tickers en references/MARKETS_REFERENCE.md.
| Comportamiento | Recomendación |
|---|---|
| Requests seguidos sin delay | 429 Too Many Requests |
| Delay recomendado | 3 segundos entre requests |
| Tickers por ejecución | ~5-6 como máximo (para evitar bloqueo) |
| Backoff | Si recibís 429, esperá 30-60s |
| Error | Causa | Solución |
|---|---|---|
429 Too Many Requests | Rate limit | Aumentar --delay o esperar |
slug not found | No se pudo resolver el ticker | Usar --slug manualmente |
No data found for X | Endpoint no disponible | Verificar que el ticker existe en Macrotrends |
originalData not found | Página cambió estructura | Reportar issue |
skills/macrotrends/
├── SKILL.md # Este archivo
├── references/
│ ├── STATEMENTS_REFERENCE.md # Referencia de campos
│ └── MARKETS_REFERENCE.md # Cobertura de mercados y ADRs
└── scripts/
└── fetch_financials.py # Script principal