Skip to content

aida-solat/YouTube-Data-Analysis

Repository files navigation

📊 YouTube Data Analysis & Sentiment Dashboard

This project analyzes trending YouTube videos and user comments using the YouTube Data API. It performs sentiment analysis, extracts insights on viewer engagement, and visualizes results through an interactive Streamlit dashboard.

🚀 Features

  • 🔄 Fetch trending YouTube videos and metadata
  • 💬 Collect and analyze user comments
  • 🧠 Perform sentiment analysis using VADER and TextBlob
  • 📈 Trend analysis of channels and videos
  • 🌐 Region-wise filtering and visualization
  • 📊 Interactive dashboard built with Streamlit

🛠️ Tech Stack

  • Languages & Tools: Python, SQL, Streamlit
  • Libraries: Pandas, Matplotlib, SQLAlchemy, TextBlob, VADER Sentiment
  • API: YouTube Data API (v3)
  • Database: PostgreSQL

🗂️ Project Structure

.
├── analyze_trends.py         # Analyzes top comments and channels  
├── dashboard.py              # Streamlit dashboard  
├── sentiment_analysis.py     # VADER-based sentiment scoring  
├── trending-videos.py        # Pulls trending videos from YouTube API  
├── video-comments.py         # Fetches video comments & applies sentiment (TextBlob)  
├── youtube-channels.py       # Fetches channel info  
├── requirements.txt          # Python dependencies  

📦 Setup Instructions

1. Clone the Repository

git clone https://github.com/aida-solat/youtube-data-analysis.git
cd youtube-data-analysis

2. Set Up Python Environment

python -m venv venv
source venv/bin/activate  # on Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Configure PostgreSQL

Make sure PostgreSQL is installed and running. Then:

  • Create a database named youtube-data-analysis
  • Update credentials if needed in the .py files

4. Set Up YouTube Data API


▶️ How to Run

Collect Data

python trending-videos.py
python video-comments.py

Perform Sentiment Analysis

python sentiment_analysis.py

Analyze Trends

python analyze_trends.py

Launch Dashboard

streamlit run dashboard.py

📊 Dashboard Preview

The dashboard allows you to:

  • Select a region (e.g., US, IN, GB)
  • View top comments by likes
  • Generate word clouds
  • Explore sentiment distributions

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages