How to use the Product Offers Script in Google Sheets

A few simple steps to follow if you want to use ShoppingScraper in Google Sheets:

  1. Copy this sheet by confirming 'make a copy'
  2. Allow access by clickin on the #REF! fields and confirm 'Allow access' to show images (to show favicons and thumbnails)
  3. Go to the settings tab
  4. Enter your API key 
  5. You can find your API key after registering on shoppingscraper.com in the account tab
  6. Paste some EAN codes in the designated grey areas (Input)

 

How to use the Product Offers Script in Google Sheets

This custom Google Apps Script function allows you to fetch product offers from Google Shopping based on EAN codes. Here's how to use it:

  1. Open your Google Sheet
  2. Go to Extensions > Apps Script
  3. Replace the existing code with the provided script
  4. Save the project and give it a name

Using the function

In your Google Sheet, you can now use the custom function like this:

=getProductOffers(A1:A10, "YOUR_API_KEY")

Parameters

  1. EAN input: Cell range or comma-separated list of EANs
  2. API key: Your API key from beta.scraper.cc
  3. Site domain (optional): Default is "shopping.google.nl"
  4. Order (optional): "cheapest" (default) or "all"
  5. Offers type (optional): "total" (default) or "cheapest"
  6. Show headers (optional): TRUE (default) or FALSE

Examples

  1. Basic usage:
 
=getProductOffers("1234567890123", "YOUR_API_KEY")
 
  1. Multiple EANs:
=getProductOffers("1234567890123,9876543210987", "YOUR_API_KEY")
 
  1. Custom site and order:
=getProductOffers(A1:A10, "YOUR_API_KEY", "shopping.google.com", "all")
 
  1. Only cheapest offer without headers:
=getProductOffers(A1:A10, "YOUR_API_KEY", "shopping.google.nl", "cheapest", "cheapest", FALSE)

This script will fetch product offers based on the provided EAN codes and return details such as price, seller information, and product URLs. It handles large batches of EANs efficiently and includes caching for improved performance.