Skip to main content

Shopping Offers by Barcode

Google Shopping no longer matches raw barcodes — pasting a GTIN/UPC/EAN into Shopping returns nothing. The /v1/google/shopping/offers endpoint bridges that gap: it resolves the barcode to a product via a Google web search, then returns that product’s Google Shopping seller offers — one entry per merchant source, each with its own price.

How It Works

  1. The barcode is validated (length + check digit). GTIN-8, UPC-A, EAN-13, and GTIN-14 are accepted.
  2. A Google web search resolves the barcode to a product (the matched product name is returned as resolved_query / product_title).
  3. A Google Shopping fetch for that product returns the per-merchant offers.
Because this performs two Google fetches, each call costs 14 credits.

Query Parameters

barcode
string
required
Product barcode to look up. Accepts GTIN-8, UPC-A (12 digits), EAN-13, or GTIN-14. The check digit is validated — a malformed or checksum-failing barcode returns 422.Example: 0711719541028
gl
string
Country to run the search and Shopping fetch in, as an ISO-3166 alpha-2 code. Controls which merchants and currency you see.Examples: us, au, gb, de
hl
string
default:"en"
Language code for the search and results.Examples: en, de, fr

Example

curl "https://scrapebadger.com/v1/google/shopping/offers?barcode=0711719541028" \
  -H "x-api-key: YOUR_API_KEY"
Pass gl to scope to a regional marketplace — for example, an Australian Woolworths grocery barcode:
curl "https://scrapebadger.com/v1/google/shopping/offers?barcode=9300633572457&gl=au" \
  -H "x-api-key: YOUR_API_KEY"

Response Shape

{
  "barcode": "0711719541028",
  "resolved_query": "Sony PlayStation 5 Console",
  "product_title": "Sony PlayStation 5 Console",
  "offers": [
    {
      "title": "PlayStation 5 Console (Slim)",
      "source": "Walmart",
      "price": { "value": 499.0, "currency": "USD", "extracted": "$499.00" },
      "link": "https://www.walmart.com/ip/PlayStation-5-Console/...",
      "rating": 4.8
    },
    {
      "title": "Sony PlayStation 5 Slim Disc Console",
      "source": "Best Buy",
      "price": { "value": 499.99, "currency": "USD", "extracted": "$499.99" },
      "link": "https://www.bestbuy.com/site/...",
      "rating": 4.7
    }
  ]
}
FieldDescription
barcodeThe barcode you passed in, echoed back.
resolved_queryThe product query the barcode resolved to via Google web search.
product_titleThe matched product’s title.
offersList of per-merchant Shopping offers.
offers[].titleThe product title as listed by that merchant.
offers[].sourceThe merchant / seller name (e.g. Walmart, Best Buy).
offers[].price.valueNumeric price.
offers[].price.currencyISO currency code.
offers[].price.extractedThe price as displayed, including symbol.
offers[].linkLink to the merchant’s listing.
offers[].ratingProduct rating on that merchant, if shown.

Pricing

Each call costs 14 credits — it runs two Google fetches (one web search to resolve the barcode, one Shopping fetch for the offers).

Errors

StatusMeaning
422The barcode is malformed or fails its check-digit validation.
404The barcode is valid but could not be resolved to a product (no Google web-search match).

Why This Exists

Google Shopping indexes by product, not by barcode — a GTIN/UPC/EAN typed directly into Shopping yields no matches. Resolving the barcode through a normal Google web search first finds the product page, and only then does a Shopping fetch return the seller offers. This endpoint packages that two-step flow into a single call so you can go straight from a barcode to live multi-seller prices.