OpenParable
Skip to content
← Back to skills

Companiesmarketcap

Research
companiesmarketcap

Companiesmarketcap is an Agent Skill for research published in the gauss314/skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Scraper de CompaniesMarketCap: rankings (marketcap, earnings, revenue, employees, ratios), stock history y ETF holdings. Sin API key.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/gauss314/skills/blob/HEAD/skills/companiesmarketcap/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/companiesmarketcap, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

CompaniesMarketCap — Financial Rankings Scraper

Scraper de CompaniesMarketCap que extrae rankings financieros (market cap, earnings, revenue, employees, P/E, márgenes, activos, deuda, cash), marketcap histórico de stocks y ETF holdings.

Usa el sistema de CSV download nativo del sitio (?download=csv) — no requiere API key y es más mantenible que scrapear HTML.


⚠️ Aviso Legal

  • CompaniesMarketCap no tiene API pública oficial. Usa el endpoint CSV que está públicamente disponible.
  • Respetá los términos de servicio del sitio.
  • Implementá rate limiting (mín 2 segundos entre requests).

Instalación

pip install requests beautifulsoup4

Scripts

ScriptDescripción
fetch_cmc.pyScript principal: rankings, stock history, ETF holdings

Uso rápido

# Ranking de market cap (default)
python scripts/fetch_cmc.py --rankings

# Ranking de earnings
python scripts/fetch_cmc.py --rankings --metric earnings

# Ranking de revenue (top 10)
python scripts/fetch_cmc.py --rankings --metric revenue --limit 10

# Stock marketcap histórico
python scripts/fetch_cmc.py --stock NVDA
python scripts/fetch_cmc.py --stock GGAL

# ETF holdings
python scripts/fetch_cmc.py --etf SPY --holdings

# Todo junto + output a JSON
python scripts/fetch_cmc.py --stock AAPL --rankings --output aapl_full.json

# Modo silencioso (solo JSON)
python scripts/fetch_cmc.py --rankings --metric earnings --limit 5 --quiet

Endpoints

FlagDataMétodoDetalle
--rankingsRanking listCSV download12 métricas + ETFs, ~10,852 empresas
--stock TICKERMarketcap históricoHTML28-31 años por stock
--etf TICKER --holdingsETF holdingsHTML~505 posiciones (SPY)
--etf TICKERETF summaryHTMLInformación del ETF

Rankings disponibles (--metric)

MétricaDescripción
marketcap (default)Market Capitalization
earningsEarnings (TTM)
revenueRevenue (TTM)
employeesEmployee count
pe_ratioPrice/Earnings ratio
operating_marginOperating margin (TTM)
total_assetsTotal assets
net_assetsNet assets
liabilitiesTotal liabilities
debtTotal debt
cashCash on hand
pb_ratioPrice/Book ratio
etfsETF market caps

Flags adicionales

FlagDescripción
--limit NLimitar a N filas en rankings
--output archivo.jsonGuardar output a archivo
--delay NDelay entre requests (default: 2.0s)
--quietModo silencioso (solo JSON)

Resolución automática ticker → slug

El scraper resuelve automáticamente el slug de la URL a partir del nombre de la compañía en el CSV:

TickerNombre → Slug
NVDANVIDIA → nvidia
AAPLApple → apple
GGALGalicia Financial Group → galicia-financial-group
SPYSPDR S&P 500 ETF → spdr-sp-500-etf
BRK-BBerkshire Hathaway → berkshire-hathaway

Estructura del skill

skills/companiesmarketcap/
├── SKILL.md                              # Este archivo
├── references/
│   └── REFERENCE.md                      # Documentación completa
└── scripts/
    └── fetch_cmc.py                      # Script principal

📖 Documentación detallada: Consultá references/REFERENCE.md para la documentación exhaustiva de cada endpoint, columnas, ejemplos y consideraciones técnicas.