https://github.com/ankulmaurya88/youtube-comment-extractor
Extract and analyze YouTube video comments using Python, Flask, and the YouTube Data API
https://github.com/ankulmaurya88/youtube-comment-extractor
comments-analysis csv-export data-extraction django docker docker-compose json-export web-app youtube-api youtube-data-api
Last synced: about 1 year ago
JSON representation
Extract and analyze YouTube video comments using Python, Flask, and the YouTube Data API
- Host: GitHub
- URL: https://github.com/ankulmaurya88/youtube-comment-extractor
- Owner: ankulmaurya88
- Created: 2025-04-15T16:43:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-15T18:26:02.000Z (about 1 year ago)
- Last Synced: 2025-04-15T18:28:57.511Z (about 1 year ago)
- Topics: comments-analysis, csv-export, data-extraction, django, docker, docker-compose, json-export, web-app, youtube-api, youtube-data-api
- Language: Python
- Homepage:
- Size: 25.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# πΊ YouTube Comment Extractor
The **YouTube Comment Extractor** is a web-based application that allows users to extract comments from any public YouTube video using the YouTube Data API. It provides a simple UI to input a video URL and download the comments in both CSV and JSON formats. The application is built using Python and Flask, and is deployable with Docker for scalable setups.
---
## π Table of Contents
1. [Features](#-features)
2. [Screenshots](#-screenshots)
3. [Input & Output](#-input--output)
4. [Technologies Used](#-technologies-used)
5. [Project Structure](#-project-structure)
6. [Installation Guide](#-installation-guide)
7. [Docker Deployment](#-docker-deployment)
8. [Usage](#-usage)
9. [License](#-license)
10. [Author](#-author)
---
## β¨ Features
- β
Extracts all top-level and nested YouTube comments using the video URL
- β
Supports comment metadata (author, time, likes, etc.)
- β
Download data as **CSV** or **JSON**
- β
Simple and clean Flask-based web UI
- β
Docker support for easy deployment
---
## πΈ Screenshots
### πΉ Home Page

### πΉ Extracted Comments Displayed

---
## π§ͺ Input & Output
### π Input:
Paste a public YouTube video URL in the input box, for example:
### π€ Output:
Youβll get a table of comments with the following fields:
| Comment ID | Author Name | Comment Text | Published At | Like Count |
|------------|-------------|----------------------|----------------------|------------|
| abc123 | John Smith | Great content! π | 2024-06-10 11:30 AM | 102 |
| def456 | Jane Doe | Thanks for sharing π | 2024-06-10 12:00 PM | 87 |
You can download this as:
- `comments.csv`
- `comments.json`
---
## π§° Technologies Used
| Area | Tools and Frameworks |
|--------------|------------------------------------|
| Language | Python 3.8+ |
| Backend | Flask |
| API | YouTube Data API v3 |
| Data Export | Pandas |
| UI | HTML, CSS |
| Deployment | Docker, Docker Compose |
---
## π Project Structure
---
## βοΈ Installation Guide
### Prerequisites
- Python 3.8+
- YouTube Data API Key
- Git
### Steps
```bash
# Clone the repository
git clone https://github.com/ankulmaurya88/YouTube-Comment-Extractor.git
cd YouTube-Comment-Extractor
# Create and activate virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Add your YouTube API Key
cp .env.example .env
# Edit the .env file and add your API key
# Run the Flask app
python3 manage.py runserver
```
---
## β¨ Docker Deployment
---
```bash
# Clone the repo
git clone https://github.com/ankulmaurya88/YouTube-Comment-Extractor.git
cd YouTube-Comment-Extractor
# Add your API key
cp .env.example .env
# Build and run with Docker Compose
docker-compose up --build
```
---
## π Usage
---
1.Open the app in your browser.
2.Paste a valid YouTube video URL.
3.Click βExtract Comments.β
4.View results in a table format.
5.Download the comments in CSV or JSON format.
## π License
---
-This project is licensed under the MIT License β see the LICENSE file for details.
## π€ Author
---
Ankul Maurya
GitHub: @ankulmaurya88
LinkedIn: linkedin.com/in/ankulmaurya
---
### Key Updates:
- **Input and Output**: Clearly describes the expected format of the input (YouTube URL) and output (comments table with fields).
- **Technologies Used**: Listed the main tools and frameworks.
- **Project Structure**: Detailed the file structure, making it easier for developers to understand the organization of the codebase.