A data analysis project demonstrating how to extract, clean, and visualize financial data using APIs and web scraping techniques.
This project focuses on collecting stock price and revenue data from multiple sources using different data extraction methods:
- Alpha Vantage API – raw financial data extraction using HTTP requests
- yfinance – simplified access to Yahoo Finance data
- Macrotrends – revenue data collected via web scraping
The goal is to demonstrate real-world data collection workflows, including API handling, JSON parsing, HTML scraping, and time series visualization.
- Python
- Jupyter Notebook
- pandas
- matplotlib
- requests
- BeautifulSoup
- yfinance
├── Stock_Data_Extraction.ipynb └── README.md
- Retrieved stock price (Apple) data using REST API requests
- Parsed nested JSON responses into pandas DataFrames
- Worked with daily time series data
Limitations: The free tier of Alpha Vantage allows up to 25 requests per day. When limits are exceeded, the API returns informational messages instead of data. Certain Alpha Vantage endpoints require a paid premium subscription. When unavailable, alternative data sources such as yfinance can be used to complement analysis.
- Retrieved historical stock prices (Tesla)
- Extracted financial statements and revenue data
- Leveraged built-in DataFrame outputs for efficient analysis
- Extracted revenue data (GameStop) from HTML tables
- Parsed webpage content using BeautifulSoup
- Cleaned and structured scraped data into pandas DataFrames
- Identified and inspected tables within the webpage
- Time series plots for stock prices
- Revenue trends
API keys are treated as sensitive credentials and are not stored directly in the code. Instead, they should be managed using environment variables or configuration files excluded from version control to prevent unauthorized access.
- Working with REST APIs
- JSON parsing and data transformation
- Web scraping with BeautifulSoup
- Data cleaning and preprocessing
- Time series visualization
This project is for educational purposes only. Financial data from external sources may contain inaccuracies or delays.
This project is licensed under the MIT License.