How to Scrape Bing Shopping Results
Google has Google Shopping results and in my previous blog post, I showed you how to scrape shopping results from Google with a few lines of code.
Bing from Microsoft also provides rich shopping results with Bing Shopping Results. Luckily, SerpApi offers high-quality Bing Shopping Results APIs.
By scraping Bing Shopping Results, you can do market research, analyze trends, popular products, compare product offerings, as well as prices and promotions.
You can also pull all the data to your website, mobile app, or tools to grow your business.
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 the results, you can utilize SERP APIs using your API Key.
Scrape your first Bing Shopping Results with SerpApi
Head to the Bing Shopping Results from the documentation on SerpApi for details.
In this tutorial, we will scrape Bing Shopping Results when searching with the "iPhone 15" keyword. The data contains: "title", "link", "seller", "price", "extracted_price", "rating", "reviews", "thumbnail", "price_history_link", "free_shipping" 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': 'bing_shopping', # SerpApi search engine
'q': 'iphone'
}
To retrieve Bing Shopping Results for a given search term, you can use the following code:
results = serpapi.Client().search(params).get_dict()['shopping_results']
You can store Bing Shopping Results JSON data in databases or export them to a CSV file.
import csv
header = ['title', 'link', 'seller', 'price', 'extracted_price', 'rating', 'reviews', 'thumbnail', "price_history_link", "free_shipping"]
with open('bing_shopping.csv', 'w', encoding='UTF8', newline='') as f:
writer = csv.writer(f)
writer.writerow(header)
for item in results:
print(item)
writer.writerow([item.get('title'), item.get('link'), item.get('seller'), item.get('price'), item.get('extracted_price'), item.get('rating'), item.get('reviews'), item.get('thumbnails')[0], item.get('price_history_link'), item.get('free_shipping')])
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.