Music videos have a huge role in the music industry. Not only for promotional purposes, but music videos are also created to represent the image of the artists and visualize the interpretation of the songs.

In this digital era, Youtube has become the most dominant streaming platform worldwide. There’s a lot of music videos with various genres, exist on Youtube. It can’t be denied, one of the ways to see the popularity in the music industry is by looking at the music video trends on Youtube.

_Are you ever curious about what is the most searched music video on Youtube? _Because I have been. That’s why I tried to figure out the search trends of Youtube, by using Pytrends. Pytrends is an API for Google Trends, which allows you to retrieve the trending on Google search engine, including Youtube. In this tutorial, I would like to show you how to get insights into the Youtube search trending in Python.

Project Set-up

The first thing you need to do is install the Pytrends and Folium package via pip.

pip install pytrends
pip install folium

After installing the API, open your Jupyter notebook and then import the necessary library, including:

  1. Pandas to handle the Dataframe,
  2. Seaborn and Matplotlib to create the charts,
  3. Folium to create the map visualization.
from pytrends.request import TrendReq
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import folium

The next steps are connecting to Google and determining what kind of data that we want to get from Pytrends.

pytrends = TrendReq(hl='en-US', tz=360)

kw_list = ["music video", "mv"]
pytrends.build_payload(kw_list, cat=0, timeframe='today 5-y', geo='', gprop='youtube')

In this case, I used the “Music Video” and “MV” as the main keywords. Also, I used it as a timeframe to retrieve the data from the last 5 years.

#python #data-visualization #youtube #data-analysis

Analyzing Music Video Trends in Youtube using Python
58.70 GEEK