This project utilizes Python to fetch real-time YouTube metrics such as likes, views, comments, and favorites. The data is streamed via Kafka, processed using ksqlDB, and subsequently sent to a Telegram bot for real-time notifications.
- Python 3.10 (minimum)
- Kafka
- Telegram API
- Docker
- Confluent Containers (Zookeeper, Kafka, Schema Registry, Connect, ksqlDB, Control Center)
-
Clone the repository.
git clone https://github.com/airscholar/YoutubeAnalytics.git
-
Install dependencies.
pip install -r requirements.txt
-
Ensure the Docker and Confluent containers set up.
-
Make a
config
folder withconfig.local
in it and set the following:[youtube]
: SectionAPI_KEY
: Your YouTube API KeyPLAYLIST_ID
: The YouTube playlist ID you want to track
-
Set up your Kafka server address in the main script, by default, it's set to
localhost:9092
.
- Start your Kafka and other Confluent services on Docker with
docker compose up -d
- Run the Python script.
python youtube_analytics.py