Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

328 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Š S&P 100 Financial Tracker

Real-time dashboard tracking comprehensive financial metrics and market capitalizations for S&P 100 companies with automated updates. 100% FREE data sources!

Data Source Price Data Deployment Automation Cost

โœจ Features

๐Ÿ’ฐ 100% FREE Data Stack

  • SEC EDGAR for comprehensive financial statements (unlimited, official)
  • Yahoo Finance for real-time stock prices (unlimited, no API key)
  • No paid APIs - save $50-100+/month vs competitors
  • No API keys required for core functionality

๐Ÿ“Š Enhanced Company Cards

Each company displays 8+ financial metrics:

  • ๐Ÿ’ฐ Revenue - Total sales
  • ๐Ÿ’ต Earnings (Net Income) - Bottom line profit
  • โš™๏ธ Operating Income - Operating profit before taxes
  • ๐Ÿ’ธ Free Cash Flow - Cash available after CapEx
  • ๐Ÿ—๏ธ CapEx - Capital expenditures (investments)
  • ๐Ÿ“Š Total Assets - Balance sheet assets
  • ๐Ÿ“ˆ Debt-to-Equity Ratio - Leverage analysis
  • ๐Ÿ“‰ Profit Margin - Profitability percentage
  • ๐Ÿ’Ž Market Cap - Current market valuation

๐Ÿค– Automated Updates

  • Weekly financial data - Every Monday at 6 AM UTC (after SEC weekend filings)
  • Daily market caps - Weekdays at 10 PM UTC (after market close)
  • GitHub Actions - Efficient automation (~60 min/month, $0 cost)
  • Smart commits - Only updates when data actually changes

๐Ÿ“ˆ Interactive Dashboard

  • Sortable list by CapEx, Revenue, Earnings, Market Cap, Sector
  • Advanced filtering by sector and search functionality
  • Live statistics showing totals, averages, and trends
  • Responsive design - Works on desktop, tablet, and mobile

๐Ÿ“‰ Chart Visualizations

  • 7 different chart types including scatter plots, bar charts, pie charts
  • CapEx vs Market Cap correlation analysis
  • Sector-wise breakdowns and comparisons
  • Top performers ranking and insights

๐ŸŽฏ Insights & Analytics

  • Investment efficiency metrics and analysis
  • Sector performance comparisons
  • Market cap correlations with business metrics
  • Statistical summaries and trend identification

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

  • Modern web browser for dashboard access
  • Python 3.9+ (optional, only for manual data updates)
  • No API keys required! ๐ŸŽ‰

โšก Local Development

  1. Clone the repository

    git clone https://github.com/avalidurl/sp100-financial-tracker.git
    cd sp100-financial-tracker
  2. Start local server

    python -m http.server 8000
    # Or use any static file server
  3. Open dashboard

    http://localhost:8000
    

๐Ÿ”„ Manual Data Updates (Optional)

If you want to fetch fresh data manually:

# Install Python dependencies
pip install requests

# Fetch comprehensive financial data from SEC EDGAR
python3 fetch-comprehensive-data.py

# Or update market caps only
python3 -c "exec(open('.github/workflows/update-market-caps.yml').read().split('python3 << \\'PYTHON_SCRIPT\\'')[1].split('PYTHON_SCRIPT')[0])"

Note: Automated updates via GitHub Actions handle this for you!

๐Ÿ“ Project Structure

sp100-financial-tracker/
โ”œโ”€โ”€ ๐Ÿ  Frontend
โ”‚   โ”œโ”€โ”€ index.html                    # Main dashboard
โ”‚   โ”œโ”€โ”€ chart.html                    # Chart visualizations
โ”‚   โ”œโ”€โ”€ insights.html                 # Analytics page
โ”‚   โ”œโ”€โ”€ script.js                     # Core functionality (enhanced cards)
โ”‚   โ”œโ”€โ”€ chart-script.js               # Chart logic
โ”‚   โ”œโ”€โ”€ insights-script.js            # Analytics logic
โ”‚   โ””โ”€โ”€ styles.css                    # Enhanced card styles
โ”‚
โ”œโ”€โ”€ ๐Ÿ“Š Data
โ”‚   โ”œโ”€โ”€ data/capex_data.json          # Company financial data (101/102 companies)
โ”‚   โ”œโ”€โ”€ data/last_updated.json        # Update timestamps
โ”‚   โ””โ”€โ”€ public/data/                  # Mirror for Cloudflare Pages
โ”‚
โ”œโ”€โ”€ ๐Ÿ Data Fetching Scripts
โ”‚   โ”œโ”€โ”€ fetch-comprehensive-data.py   # Main SEC EDGAR fetcher
โ”‚   โ”œโ”€โ”€ fetch-earnings-free.py        # Earnings-only fetcher
โ”‚   โ”œโ”€โ”€ explore-sec-data.py           # SEC data explorer
โ”‚   โ””โ”€โ”€ (legacy scripts for reference)
โ”‚
โ”œโ”€โ”€ โ˜๏ธ Cloudflare Functions (API Routes)
โ”‚   โ””โ”€โ”€ functions/
โ”‚       โ””โ”€โ”€ api/
โ”‚           โ”œโ”€โ”€ stock-price.js        # Real-time prices (Yahoo Finance)
โ”‚           โ”œโ”€โ”€ quota-status.js       # API status (all free!)
โ”‚           โ”œโ”€โ”€ cache.js              # 5-min price caching
โ”‚           โ””โ”€โ”€ rate-limit.js         # Abuse protection
โ”‚
โ”œโ”€โ”€ ๐Ÿค– Automation
โ”‚   โ””โ”€โ”€ .github/workflows/
โ”‚       โ”œโ”€โ”€ update-financial-data.yml # Weekly SEC EDGAR updates
โ”‚       โ””โ”€โ”€ update-market-caps.yml    # Daily Yahoo Finance updates
โ”‚
โ””โ”€โ”€ ๐Ÿ“š Documentation
    โ”œโ”€โ”€ SEC-EDGAR-GUIDE.md            # How to use SEC EDGAR data
    โ”œโ”€โ”€ PRICE-DATA-SOURCES.md         # Price data explanation
    โ”œโ”€โ”€ GITHUB-ACTIONS-BILLING-CHECK.md # Cost analysis
    โ””โ”€โ”€ EARNINGS-SETUP.md             # Setup guide

๐Ÿ›๏ธ Data Sources

SEC EDGAR (Financial Statements)

  • URL: https://www.sec.gov/edgar
  • Cost: 100% FREE, unlimited
  • Rate Limit: 10 requests/second
  • Data: Official company filings (10-K annual reports)
  • Metrics: Revenue, Earnings, CapEx, Operating Income, Balance Sheet, Cash Flow

Yahoo Finance (Stock Prices)

  • URL: https://finance.yahoo.com/
  • Cost: 100% FREE, unlimited
  • Rate Limit: None (reasonable use)
  • Data: Real-time stock prices, market caps, volume
  • Metrics: Current price, market capitalization, day high/low

Data Freshness

  • Financial statements: Latest annual 10-K filing (updated weekly)
  • Market caps: Updated daily after market close
  • Stock prices: Real-time via Cloudflare Functions

๐Ÿ“Š Data Schema

Company Record Structure

{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "sector": "Technology",
  "year": 2024,
  "period": "2024-Q4 (Annual)",
  
  // Income Statement
  "revenue": 394328000000,
  "earnings": 99803000000,
  "operating_income": 123216000000,
  "gross_profit": 169148000000,
  
  // Cash Flow Statement
  "capex": -10959000000,              // Negative = investment
  "operating_cash_flow": 118254000000,
  "free_cash_flow": 107295000000,     // Calculated: OpCF + CapEx
  
  // Balance Sheet
  "total_assets": 364980000000,
  "total_liabilities": 279414000000,
  "stockholders_equity": 85566000000,
  "long_term_debt": 106611000000,
  "cash": 61555000000,
  
  // Calculated Metrics
  "debt_to_equity": 1.25,              // Long-term Debt / Equity
  "profit_margin": 25.3,               // (Earnings / Revenue) * 100
  "operating_margin": 31.2,            // (Operating Income / Revenue) * 100
  
  // Market Data (updated daily)
  "market_cap": 3450000000000,
  "market_cap_updated": "2025-01-08T22:00:00Z",
  
  // Additional
  "rd_expense": 31300000000,
  "shares_outstanding": 15204100000
}

๐Ÿš€ Deployment

Cloudflare Pages (Current Deployment)

Automatic deployment on every git push:

  1. Connect GitHub repository to Cloudflare Pages
  2. Configure build settings:
    • Build Command: (none - static site)
    • Build Output Directory: /
    • Root Directory: /
  3. Deploy automatically on git push to master

Custom Functions (API Routes):

  • Cloudflare Pages Functions in functions/ directory
  • Serverless functions for stock prices and API status
  • Global edge deployment (275+ locations)

GitHub Actions Setup

Already configured! No action needed.

Workflows automatically:

  • โœ… Fetch financial data from SEC EDGAR (Mondays 6 AM UTC)
  • โœ… Update market caps from Yahoo Finance (Weekdays 10 PM UTC)
  • โœ… Commit changes to git (only if data changed)
  • โœ… Trigger Cloudflare Pages deployment

Cost: $0/month (public repo = unlimited free minutes)

๐Ÿ’ฐ Cost Breakdown

Current Architecture (100% FREE!)

Service Usage Cost
SEC EDGAR Unlimited financial data $0 โœ…
Yahoo Finance Unlimited price data $0 โœ…
GitHub Actions 60 min/month (public repo) $0 โœ…
Cloudflare Pages Unlimited bandwidth $0 โœ…
Cloudflare Functions 100k requests/day (free tier) $0 โœ…
TOTAL $0/month ๐ŸŽ‰

vs Paid Alternatives:

  • Financial APIs (Bloomberg, FMP, etc.): $30-100/month
  • Private GitHub repo: $4-6/month for Actions
  • You save: $408-1,272/year with this stack! ๐Ÿ’ฐ

๐Ÿ› ๏ธ Development

Common Commands

# Fetch comprehensive financial data (all metrics)
python3 fetch-comprehensive-data.py

# Explore available metrics for a company
python3 explore-sec-data.py AAPL

# Test locally
python -m http.server 8000

# Check linter
# (No linter errors! โœ…)

# Validate JSON data
python3 -c "import json; data=json.load(open('data/capex_data.json')); print(f'โœ“ {len(data)} companies loaded')"

Data Update Workflows

  • Automated Updates: GitHub Actions handle scheduling (recommended)
  • Manual Updates: Run Python scripts locally when needed
  • Emergency Updates: Use GitHub Actions "workflow_dispatch" manual trigger

Monitoring

Check automation status:

๐Ÿ› Troubleshooting

Common Issues

No Data Showing

# Check if data files exist
ls -lh data/capex_data.json

# Validate JSON
python3 -c "import json; json.load(open('data/capex_data.json'))"

# Check browser console for errors
# Open DevTools (F12) โ†’ Console tab

GitHub Actions Failing

# Check workflow runs
# Visit: https://github.com/avalidurl/sp100-financial-tracker/actions

# Test locally
python3 fetch-comprehensive-data.py

# Check SEC EDGAR rate limit (10 req/sec)
# Script already respects this with 0.15s delay

Market Caps Not Updating

# Check last update timestamp
cat data/last_updated.json

# Manually trigger workflow
# Go to Actions โ†’ "Update Market Caps" โ†’ "Run workflow"

# Test Yahoo Finance connectivity
python3 -c "import requests; r=requests.get('https://query1.finance.yahoo.com/v8/finance/chart/AAPL'); print(r.status_code)"

Cloudflare Pages Not Deploying

# Check deployment status
# Visit: Cloudflare Dashboard โ†’ Pages โ†’ sp100-financial-tracker

# Verify git push succeeded
git log --oneline -5

# Check for build errors in Cloudflare logs

๐Ÿ“š Documentation

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Make changes and test locally
  4. Commit changes: git commit -m 'Add amazing feature'
  5. Push to branch: git push origin feature/amazing-feature
  6. Open Pull Request

Development Guidelines

  • โœ… Use semantic commit messages
  • โœ… Test changes locally before pushing
  • โœ… Ensure no linter errors
  • โœ… Update documentation if needed
  • โœ… Keep data fetching 100% free (no paid APIs)

๐ŸŽฏ Roadmap

โœ… Completed

  • 100% FREE data stack (SEC EDGAR + Yahoo Finance)
  • Enhanced company cards (8+ metrics)
  • Automated GitHub Actions workflows
  • Optimized API usage (98% reduction)
  • Comprehensive financial data (101/102 companies)
  • Real-time price updates
  • Debt-to-Equity, Profit Margin calculations

๐Ÿšง In Progress

  • Add automated testing (unit + integration)
  • Implement error monitoring (Sentry)
  • Add workflow failure notifications

๐Ÿ”ฎ Future Ideas

  • Historical data tracking (quarterly trends)
  • Company comparison tool (side-by-side)
  • Export to CSV/Excel functionality
  • Mobile app (React Native)
  • Real-time WebSocket price updates

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • SEC (U.S. Securities and Exchange Commission) for providing free, unlimited access to company financials
  • Yahoo Finance for real-time stock price data
  • Cloudflare Pages for global edge hosting and serverless functions
  • GitHub Actions for free CI/CD automation

๐Ÿ“Š Project Stats

  • 102 Companies tracked continuously
  • 8+ Metrics per company card
  • 500+ Data Points available per company from SEC EDGAR
  • 2 Update Frequencies (weekly financial data, daily market caps)
  • 100% Free - no paid APIs or subscriptions
  • $0/month Cost for hosting and automation
  • ~60 min/month GitHub Actions usage (within free tier)

๐Ÿš€ Live Dashboard โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ›๏ธ SEC EDGAR

Made with ๐Ÿ’ฐ for financial analysis and ๐Ÿ“Š powered by 100% FREE data sources

Zero cost. Unlimited data. No API keys needed. ๐ŸŽ‰

About

Ultra-lightweight S&P 100 tracker with real-time data

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages