How to Scrape Yahoo Videos Results
In my previous blog posts, I showed how easy it is to get Yahoo Search Results like organic results. Yahoo Videos is another of the best video search results for your research, and business.
Yahoo provides you the ability to search videos on the internet, from different sources. Yahoo Videos also supports to filter videos by length, uploaded time, resolution, and source.
Content creators and digital marketers can use video data to enrich their websites and YouTube channels. Doing the competitive analysis of video content with keywords, and ranking to improve marketing strategies.
You can also monitor trends in video content to get more insights into popular topics. With the power of AI, you can feed your video data into AI and make your own videos.
If you want to extract video data from Yahoo quickly, supported by all filters, and highly maintained, SerpApi is the best choice in the market.
Setting up a SerpApi account
SerpApi offers a free plan for newly created accounts. Head to the sign-up page to register an account and complete your first search with our interactive playground. When you want to do more searches with us, please visit the pricing page.
Once you are familiar with all results, you can utilize SERP APIs using your API Key.
Scrape your first Yahoo Videos results with SerpApi
Head to the Yahoo Videos Results from the documentation on SerpApi for details.
In this tutorial, we will scrape videos results when searching with the "coffee" keyword. The data contains: "position", "title", "link", "thumbnail", "source", "date", "duration" and more. You can also scrape more information with SerpApi.
First, you need to install the SerpApi client library.
pip install google-search-results
Set up the SerpApi credentials and search.
import serpapi, os, json
params = {
'api_key': 'YOUR_API_KEY', # your serpapi api
'engine': 'yahoo_videos', # SerpApi search engine
'p': 'coffee'
}
To retrieve Yahoo Videos Results for a given search term, you can use the following code:
results = serpapi.Client().search(params)["videos_results"]
You can store Videos Results JSON data in databases or export them to a CSV file.
import csv
header = ['position', 'title', 'link', 'thumbnail', 'source', 'date', 'duration']
with open('yahoo_videos.csv', 'w', encoding='UTF8', newline='') as f:
writer = csv.writer(f)
writer.writerow(header)
for item in results:
print(item)
writer.writerow([item.get('position'), item.get('title'), item.get('link'), item.get('thumbnail'), item.get('source'), item.get('date'), item.get('duration')])
This example is using Python, but you can also use your all your favorite programming languages likes Ruby, NodeJS, Java, PHP....
If you have any questions, please feel free to contact me.