Compare prices across merchants with a Google Shopping API
A Google Shopping API gives price comparison its data without a scraper per retailer: one query returns the listings Google Shopping shows for a product, each with the merchant, a numeric price and the rating. Ecommerce teams watch competitors, marketplaces benchmark their sellers and deal sites look for the lowest offer. The Search API returns those listings as parsed JSON, one country at a time.
Competitor prices live on dozens of retailer sites with different markup
Knowing where you stand on price means checking the same product on every merchant that sells it. Each retailer renders prices its own way, loads some of them with JavaScript, formats them with local separators and currency signs, and changes its templates without warning. One scraper per site is a maintenance job that never ends.
Scraping a shopping results page looks like a shortcut, but the page is built for people: prices are strings such as “$1,699.00”, merchants are text next to a logo and ratings are stars. Turning that into numbers you can compare is another parser, and it breaks just as often as the retailer ones.
type: shopping returns every listing with title, url, publisher for the merchant, and price as a currency symbol plus an amount that is already a number. rating arrives as score, scale and review count when Google shows one. location geo-targets the listings by country, so you compare prices in the market you actually sell in.
How to track competitor prices with the Google Shopping API
Query the product, turn the listings into rows, then compare them with your own price. The shopping guide lists every field.
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const { results } = await microlink.search('sony wh-1000xm5', {
type: 'shopping',
location: 'gb'
})
const offers = results.map(({ title, publisher, price, rating, url }) => ({
title,
merchant: publisher,
amount: price.amount,
symbol: price.symbol,
rating: rating?.score,
url
}))price.amount is a number and price.symbol the currency sign, so the offers are ready to sort. rating is optional, which is why score is read with ?.
const sorted = offers.slice().sort((a, b) => a.amount - b.amount)
const lowest = sorted[0]
const median = sorted[Math.floor(sorted.length / 2)].amount
const gap = ourPrice - lowest.amountNo currency parsing: sort and aggregate amount directly. gap is how far the cheapest merchant sits below ourPrice, your own listing price.
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const markets = ['us', 'gb', 'de']
const byMarket = await Promise.all(
markets.map(async location => {
const { results } = await microlink.search('sony wh-1000xm5', {
type: 'shopping',
location
})
return { location, results }
})
)Each market is one request. Keep amounts grouped by location: symbol is the sign shown on the listing, not an ISO currency code, so never average amounts across markets.
- type 'shopping' returns title, url, publisher, price, and optional image, rating and id.
- location Two-letter country code that geo-targets the listings, such as gb or de.
- limit Maximum number of listings per page.
- page Later pages for broad queries, one request each. next() does the same from a result.
Shopping results show what Google Shopping lists, not what every retailer prints on its own product page. When you need the price from one specific page, including shops Google does not list, extract it from that page with the Microlink SDK.
Why a shopping search API beats one scraper per retailer
Price monitoring usually breaks at the parsing step. Starting from parsed listings removes the part that breaks most.
The product intelligence pattern runs thresholds and averages on the same fields.
Need pictures rather than prices? Search Google Images with full-size URLs and get the dimensions of every result.
When not to: Google Shopping does not list every retailer, and a listing is not a promise of stock or of the checkout total. For a price you match by contract, read it from the merchant’s own page. For local store details such as hours and phone, use the maps surface.
FAQ
How do I get Google Shopping prices through an API?
Can I track competitor prices over time with the Shopping API?
Does the Google Shopping price include the currency?
How many requests does product price monitoring use?
Is the price comparison API affiliated with Google?
Solve the next problem with the same API
Image search with full-size URLs and dimensions
Local business leads from Google Maps
Google rank tracking by country
Brand and media monitoring from Google News
Custom fields alongside metadata
Screenshot a site from another country
Ready to compare every merchant?
Parsed prices from Google Shopping, per country, as JSON. Get a Pro key and run your first price comparison today.