Data Collection · Class Project · March 2026

YouTube Analytics Pipeline

A class notebook that pulls stats for the top 50 YouTube results for one search query through the YouTube Data API and exports them to CSV and JSON.

PythonYouTube Data APIpandasJSON
50
videos: top results for one query
5
fields per video
CSV + JSON
exports

Overview01

A small notebook project from a course. It connects to the YouTube Data API, pulls stats for the top 50 videos returned for one search query (US region), and exports them for analysis.

How it works02

  1. Extract. Searches the YouTube Data API for one query and collects video ID, title, views, likes, and comment count for the top 50 results.
  2. Store. Exports the video stats to CSV and a sample of comment threads to JSON.
  3. Analyze. Ranks the videos by comment count and computes a likes-to-views ratio for the top 10. There is no sentiment analysis or charting in this project.

Scope03

One-shot notebook. It runs once for a single query rather than on a schedule, which kept it within API quota limits for the class assignment.

Tech

PythonYouTube Data APIpandasJSON