This project involves analyzing YouTube trending videos to gain insights into what makes a video trend. By utilizing data analytics and visualization techniques, we uncover patterns and trends in video popularity, categories, duration, and other key attributes.
- Data Collection: Fetch trending videos data using the YouTube Data API.
- Data Analysis: Analyze video attributes such as views, likes, dislikes, comments, and categories.
- Visualization: Generate visualizations to represent the data insights using libraries like Matplotlib and Seaborn.
- Export Results: Export analysis results to CSV or other formats for further use.
- Programming Language: Python
- Libraries: Pandas, NumPy, Matplotlib, Seaborn, Requests
- Development Tools: Jupyter Notebook
To get started with the project, follow these steps:
- Clone the repository:
git clone https://github.com/Matinnorouzi2023/Youtube-trending-analysis.git cd youtube-trending-analysis
- Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install the required dependencies:
pip install -r requirements.txt
- Set up your YouTube Data API key:
- Obtain an API key from the Google Developers Console.
- Create a
.env
file in the project root directory and add your API key:YOUTUBE_API_KEY=your_api_key_here
To use the analysis script, follow these steps:
- Fetch the trending videos data:
python scripts/fetch_trending_videos.py
- Run the analysis:
python scripts/analyze_trending_videos.py
- Generate visualizations:
python scripts/generate_visualizations.py
- data/: Directory for storing raw and processed data.
- notebooks/: Jupyter notebooks for exploratory data analysis.
- scripts/: Python scripts for fetching data, analyzing, and generating visualizations.
- .env: File for storing environment variables (e.g., API keys).
- requirements.txt: List of dependencies required for the project.
- README.md: This README file.
Ensure you have the YouTube Data API key set up in the .env
file. The configuration settings for the project can be adjusted in the script files as needed.
The primary data source for this project is the YouTube Data API, which provides access to various video attributes, metadata, and statistics.
The analysis script (analyze_trending_videos.py
) performs the following steps:
- Load the fetched trending videos data.
- Clean and preprocess the data.
- Perform descriptive and inferential statistical analysis.
- Identify patterns and trends in video attributes.
- Generate visualizations to represent the findings.
We welcome contributions to improve this project. If you have suggestions, bug fixes, or new features to add, please submit a pull request or open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE
file for more details.
Thank you for using the YouTube Trending Videos Analysis project! If you have any questions or need further assistance, please feel free to reach out.