https://github.com/dineshram0212/youtube-analysis
This YouTube Analysis Package provides tools for analyzing YouTube video data, including metrics on views, likes, comments, and engagement trends. Ideal for gaining insights into video performance and audience interaction patterns.
https://github.com/dineshram0212/youtube-analysis
data data-visualization pandas python webscraping youtube-api-v3
Last synced: 4 days ago
JSON representation
This YouTube Analysis Package provides tools for analyzing YouTube video data, including metrics on views, likes, comments, and engagement trends. Ideal for gaining insights into video performance and audience interaction patterns.
- Host: GitHub
- URL: https://github.com/dineshram0212/youtube-analysis
- Owner: dineshram0212
- License: other
- Created: 2022-01-23T16:49:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T05:41:26.000Z (over 1 year ago)
- Last Synced: 2026-02-15T04:52:23.210Z (4 months ago)
- Topics: data, data-visualization, pandas, python, webscraping, youtube-api-v3
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ytanalysis
`ytanalysis` is a Python package designed to analyze YouTube channel statistics using the YouTube Data API. With this package, you can retrieve information about a YouTube channel, including subscriber count, video details, views, likes, comments, and more. It also provides visualization tools to help analyze video views and monthly posting frequency.
## Features
- Retrieve detailed YouTube channel statistics (subscribers, views, total videos, etc.)
- Extract video statistics such as views, likes, and comments
- Export video data to a CSV file for further analysis
- Generate visualizations for top-performing videos and monthly posting frequency
## Installation
To install this package, use `pip`:
```bash
pip install ytanalysis
```
## Prerequisites
You need a YouTube Data API key to use this package. Follow these steps to obtain one:
1. Go to the [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project (or select an existing one) and navigate to **APIs & Services** > **Library**.
3. Search for "YouTube Data API v3" and enable it for your project.
4. Go to **APIs & Services** > **Credentials** and create an API key.
5. Copy the API key for later use.
## Usage
### Initialization
To initialize the `YTAnalysis` class, replace `YOUR_YOUTUBE_API_KEY` with your actual API key and `CHANNEL_URL` with the YouTube channel URL you want to analyze:
```bash
from ytanalysis import YTAnalysis
api_key = "YOUR_YOUTUBE_API_KEY"
channel_url = "https://www.youtube.com/channel/CHANNEL_ID"
yt = YTAnalysis(channelURL=channel_url, apikey=api_key)
```
### Methods
#### Get Channel Details
```bash
channel_info = yt.getChannelDetail()
print(channel_info)
```
#### Get Video Details
```bash
video_details = yt.getVideoDetail()
print(video_details)
```
#### Export Data to CSV
```bash
yt.export_csv()
```
#### Plot Most Viewed Videos
```bash
yt.plotViews(values=10, mostViewed=True, save=False)
```
#### Plot Monthly Video Counts
```bash
yt.plotVideoCount(save=False)
```