{"library":"yfinance","code":"import yfinance as yf\nimport pandas as pd\n\n# Download historical data for a single ticker (e.g., Apple)\nticker_symbol = \"AAPL\"\ndata = yf.download(ticker_symbol, start=\"2023-01-01\", end=\"2023-12-31\")\n\nprint(f\"Downloaded {len(data)} rows for {ticker_symbol}:\")\nprint(data.head())\n\n# Access information about a ticker\nticker = yf.Ticker(ticker_symbol)\ninfo = ticker.info\nprint(f\"\\nMarket Cap for {ticker_symbol}: {info.get('marketCap')}\")","lang":"python","description":"This quickstart demonstrates how to download historical stock data for a given ticker symbol and how to access fundamental information about a company using the Ticker object.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}