Competitive Video Analysis Using YouTube Search API
You can use YouTube data to analyze details about videos which rank well for certain keywords, and use the data to research why competitors' videos are performing better. Given the sheer volume of 518,400 hours of new video content uploaded daily, getting noticed has become increasingly difficult. Thus, analyzing what changes you can make so that your video is featured in the top 10 results is key and can really help your videos gain visibility.
SerpApi provides a convenient way to scrape YouTube data with our YouTube Search API so you can conduct this analysis. In this post, let's explore how you can use it to research your competitor's videos on Youtube.
How SerpApi's Youtube API Can Help
Our Youtube API has many features which can help you with your video analysis. Let's dive deeper into them:
Youtube Search Results
Using SerpApi's YouTube Search API, you can get all resulting videos, including Youtube Shorts, for any query. You can get information about them like the number of views, title, description, link, thumbnail, etc.
This data is crucial for understanding which types of content are resonating most with users. You can learn what makes a successful video, whether it's the title length, title keywords, or even the video description. This information will give you a competitive edge, allowing you to create videos that have a higher chance of going viral and engaging your audience effectively.
YouTube Video Details
In-depth information about videos is key to assessing how and why a video is performing well. Our YouTube Video API provides comprehensive data on individual videos including, but not limited to:
- Video metadata like title, description, URL, and publishing date
- Channel information (name, subscriber count, and profile link)
- Engagement metrics (views, likes, comments)
- Chapter details
- Shopping results
- Related videos and Endscreen videos
By analyzing these details, you can identify trends in titles, descriptions, and other metadata that seem to attract higher engagement. You can also compare your content's performance to that of your competitors and identify opportunities for optimization, such as adjusting your video’s title to increase its visibility or enhancing its description with keywords that drive more traffic.
How To Leverage This Data To Improve Your Content Strategy
The key here is to understand video performance based on a couple different factors. Let's dive deeper into those:
Title, Thumbnail and Description Optimization
Data about which video titles and thumbnails garner the most attention can help you refine your own. You can use this data from high-performing competitors' videos to understand how they craft their titles and visuals to improve your click-through rates.
Here are a couple of examples for videos with the keyword "RV tour" in our playground: https://serpapi.com/playground?engine=youtube&search_query=RV+tour
Here are what the long form Video results look like:
Looking at this, we can see the titles, descriptions, and thumbnails videos had and the corresponding views they got.
You can do the same kind of research for Shorts results:
The title and description of your videos should be clear and concise, and they should accurately reflect the content of your videos.
A fun tip: You can try to check the same details for videos which don't rank super well by using our pagination token next_page_token
from the response, and providing the value in the sp
parameter in your next API call.
Keyword Research From Video Descriptions
By reviewing keywords that generate the most views for competitors, you can enhance your SEO strategy. Including these keywords in your title and description will allow your videos to rank higher in YouTube search results and be recommended to a broader audience.
You can do some manual research to find common words that occur in descriptions or you can write a small script to automate it and show you a word cloud of the most occuring keywords in video description for the top videos on Youtube for your query. Here is an example Python script of how you can do that for any search query:
from serpapi import GoogleSearch
import os
import matplotlib.pyplot as plt
from wordcloud import WordCloud
import nltk
from nltk.corpus import stopwords
# This contains common words like "the", "a", "an", etc.
nltk.download('stopwords')
params = {
"search_query": "RV tour",
"api_key": os.environ["SERPAPI_API_KEY"],
"engine": "youtube"
}
search = GoogleSearch(params)
results = search.get_dict()
descriptions = []
if "video_results" in results:
for video in results["video_results"]:
if "description" in video:
descriptions.append(video["description"])
print(video["description"])
# Combine all descriptions into one text
all_text = " ".join(descriptions)
# Remove stopwords like "the", "a", "an", etc.
stop_words = set(stopwords.words('english'))
# Create a word cloud object with custom stopwords and settings
wordcloud = WordCloud(
stopwords=stop_words,
background_color='white',
width=800,
height=600,
max_words=100,
colormap='coolwarm' # Customize color scheme here
).generate(all_text)
# Plot the word cloud
plt.figure(figsize=(10, 8))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off') # Turn off axis labels
plt.title("Word Cloud of Most Occurring Words in Descriptions", fontsize=16)
plt.show()
Before you run this script, make sure to install the various libraries we import using pip install matplotlib pandas nltk wordcloud google-search-results
. This uses SerpApi's google-search-results
library, our Python integration, which you can read more about here:
Key things to note about the script
This script uses SerpApi's google-search-results
library to fetch YouTube video descriptions based on a search query.
- Purpose: It collects words from video descriptions from search results and stores them in a list for analysis.
- The
nltk
library is used to remove stopwords like "the" and "a" to focus on meaningful words in the descriptions. - The
WordCloud
library generates a visual representation of the most frequent words from the descriptions. - The script uses
matplotlib
to display the word cloud, with axis labels removed for a cleaner look. You can customize the word cloud’s appearance, including the color scheme, max word count, and image size as you require it.
When I run this script with the search query "RV tour", I see the following most used words in the descriptions of the top Youtube videos:
shorts_results
key instead of the video_results
key from the API response. Then you can conduct the same kind of analysis for every short video. Youtube Shorts don't have descriptions, so you can analyze keywords that come up most often in the title of the results instead. Picking Hashtags
YouTube uses hashtags to categorize and help users discover content, similar to other social media platforms, and they appear above the video title when added to the description or title. You simply add hashtags to the video's description or title, and they will be displayed above the video's title. This allowed users to type hashtags into the YouTube search bar, and search for relevant videos.
For example, if you're uploading a video about "how to do a pushup," you could use hashtags like #pushups #workout #fitness.
You can use our Youtube Search API to get the title and description of the video which includes these hashtags.
Let's consider the same example for videos with the keyword "RV tour" in our playground: https://serpapi.com/playground?engine=youtube&search_query=RV+tour
You can identify common hashtags from the titles and descriptions of the top 10 videos. Here a couple that are used: #vantour #vanconversion #vanlife #viral #rvlife #42view #rvtour #rvliving #tinyhouse #fulltimerv #rv
Exploring Videos In Depth
Sometimes, you need to look at granular data about a particular video to understand what makes it perform well. You could consider analyzing videos in the 'Related Videos' section. This is what users see as their next watch suggestions. You can take a look at some videos there to see how Youtube is categorizing them as related. To do this, you can use the Video IDs for these videos to get granular data about them.
To scrape details about a certain video, you can use our Youtube Video API. This uses the Video ID to get details on a particular video. You can extract the ID for a video from the video_id
field in our Youtube Search API, or simply copy it from your the Youtube URL of any video (example: https://www.youtube.com/watch?v=kf1gWSIOpkQ). In this case, kf1gWSIOpkQ
is the video_id
we are looking for.
Here's an example of this particular video with video ID kf1gWSIOpkQ
. get the details for it using ou Youtube Video API in our playground:
Conclusion
I hope this blog post was helpful in understanding how to use our Youtube APIs to conduct analysis on competitor Youtube videos and make your videos stand out. If you have any questions, don't hesitate to reach out to me at sonika@serpapi.com.
Relevant Posts
You may be interested in reading more about our Youtube APIs, and some no code options we have: