Google Shopping Results API

To scrape Google shopping results with SerpApi, create a search with tbm parameter set to shop. (I.e., tbm=shop) The Google Shopping Results API allows a user to scrape the results of a Google Shopping search. The user must utilize the tbm parameter and set the corresponding value to shop (e.g.: tbm=shop). A user may utilize the standard parameters available. Searches for results outside the U.S. should refrain from utilizing the location parameter and only utilize our Localization parameters when seeking country-specific results: google_domain, gl, hl, and lr.

Google shopping supports list and grid layouts. To force a specific layout, tbs parameter can be used. To force list layout, set tbs=vw:l. To force grid layout, set tbs=vw:g.

API Examples

JSON structure overview

{
  ...
  "filters": [
    {
      "type": "String - Block title",
      "options": [
        {
          "text": "String - Filter name",
          "tbs": "String - tbs value"
        },
        ...
      ]
    },
    ...
  ],
  "inline_shopping_results": [
    {
      "position": "Integer - Item position",
      "block_position": "String - Block position on the page. Value can be `top` or `bottom`",
      "title": "String - Item title",
      "price": "String - Item price",
      "extracted_price": "Float - Item price as a float",
      "link": "String - Link to the Google item page",
      "source": "String - Product source name",
      "rating": "Float - Item rating",
      "reviews": "Integer - Item review count",
      "extensions": "Array - Items tags/extensions",
      "thumbnail": "Image - Base64 data or URL"
    },
  ],
  "shopping_results": [
    {
      "position": "Integer - Item position",
      "title": "String - Item title",
      "link": "String - Link to the item",
      "product_id": "String - Unique Google product identifier",
      "product_link": "String - Link to the Google item page",
      "serpapi_product_api": "String - SerpApi URL to fetch more information about this specific product",
      "source": "String - Product source name",
      "price": "String - Item price",
      "extracted_price": "Float - Item price as a float"
      "rating": "Float - Item rating",
      "reviews": "Integer - Item review count",
      "snippet": "String - Item description",
      "extensions": "Array - Item tags/extensions",
      "thumbnail": "Image - URL",
      "other_options": "Array - Other Google product variants",
      "tag": "String - Item tag ex: CURBSIDE, IN-STORE PICKUP, SALE, or FREE 2-DAY"
    },
  ],
  ...
}

Results for: TV

Results for: TV

JSON Example

{
  ...
  "shopping_results": [
    {
      "position": 1,
      "title": "LG CX Series OLED65CXPUA - 65" OLED Smart TV - 4K UltraHD",
      "link": "https://www.google.com/shopping/product/2137849703372219393?ie=UTF-8&uule=w+CAIQICInRGFsbGFzLUZ0LiBXb3J0aCxUWCxUZXhhcyxVbml0ZWQgU3RhdGVz&oq=tv&hl=en&q=tv&gl=us&prds=eto:12286545446661993535_0&sa=X&ved=0ahUKEwiqrsn87_rsAhVileAKHQ41A5QQ8wIItwY",
      "product_id": "2137849703372219393",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&location=dallas&product_id=2137849703372219393",
      "source": "Best Buy",
      "price": "$1,899.99",
      "extracted_price": 1899.99,
      "rating": 4.8,
      "reviews": 2464,
      "snippet": "Bring home the world's #1 selling OLED TV. Only OLED pixels emit their own light, allowing for perfect black, intense color ...",
      "extensions": [
        "January 2020",
        "LG",
        "65″",
        "Smart TV",
        "OLED",
        "4K",
        "57.1 in wide",
        "1.8 in deep",
        "Flat",
        "HDR"
      ],
      "thumbnail": "<URL to image>"
    },
    {
      "position": 2,
      "title": "LG CX Series OLED48CXPUB - 48" OLED Smart TV - 4K UltraHD",
      "link": "https://www.google.com/shopping/product/13327562245893406619?ie=UTF-8&uule=w+CAIQICInRGFsbGFzLUZ0LiBXb3J0aCxUWCxUZXhhcyxVbml0ZWQgU3RhdGVz&oq=tv&hl=en&q=tv&gl=us&prds=eto:772993368744162845_0&sa=X&ved=0ahUKEwiqrsn87_rsAhVileAKHQ41A5QQ8wII0QY",
      "product_id": "13327562245893406619",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&location=dallas&product_id=13327562245893406619",
      "source": "Best Buy",
      "price": "$1,499.99",
      "extracted_price": 1499.99,
      "rating": 4.8,
      "reviews": 2464,
      "snippet": "Once you've seen LG OLED TV with your own eyes, you'll understand. It's stunning picture that redefines quality. Millions of ...",
      "extensions": [
        "January 2020",
        "LG",
        "48″",
        "Smart TV",
        "OLED",
        "4K",
        "42.1 in wide",
        "1.8 in deep",
        "32.8 lb",
        "Flat"
      ],
      "thumbnail": "<URL to image>"
    },
    {
      "position": 3,
      "title": "LG CX Series OLED48CXPUB - 48" OLED Smart TV - 4K UltraHD",
      "link": "https://www.google.com/shopping/product/4295864931837274271?ie=UTF-8&uule=w+CAIQICInRGFsbGFzLUZ0LiBXb3J0aCxUWCxUZXhhcyxVbml0ZWQgU3RhdGVz&oq=tv&hl=en&q=tv&gl=us&prds=eto:3509031369685920288_0&sa=X&ved=0ahUKEwiqrsn87_rsAhVileAKHQ41A5QQ8wII6QY",
      "product_id": "4295864931837274271",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&location=dallas&product_id=4295864931837274271",
      "source": "Walmart",
      "price": "$1,496.99",
      "extracted_price": 1496.99,
      "rating": 4.8,
      "reviews": 2464,
      "snippet": "Once you've seen LG OLED TV with your own eyes, you'll understand. It's stunning picture that redefines quality. Millions of ...",
      "extensions": [
        "January 2020",
        "LG",
        "48″",
        "Smart TV",
        "OLED",
        "4K",
        "42.1 in wide",
        "Flat",
        "HDR",
        "High Definition"
      ],
      "thumbnail": "<URL to image>"
    },
    ...
  ...
}

Inline Shopping results for: Iphone

Inline Shopping results for: Iphone

JSON Example

{
  ...
  "inline_shopping_results": [
    {
      "position": 1,
      "block_position": "top",
      "title": "Apple iPhone 12 - Blue - 128GB",
      "price": "$49.99 now",
      "extracted_price": 49.99,
      "link": "https://www.google.com/aclk?sa=l&ai=DChcSEwjDzrXPivvvAhVn5uMHHftYDnYYABAGGgJ5bQ&sig=AOD64_2IeDTKs8Khtd21JRGYG3iYyszdwA&ctype=46&q=&ved=0ahUKEwjNkrDPivvvAhVFbKwKHZBTBPsQww8IuwU&adurl=",
      "source": "T-Mobile",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/shopping?q=tbn:ANd9GcSVeIqxzivUV_kt5485t1yrcf0NGaDLUeuJM8OLrMVZec5CUz2G5hWTomRWOXOUuUlcagI0LzL94Lh7h4hLHV2-8kXKR6CjiKx8Do9qJ51deLSMlqVfNjHH&usqp=CAE",
      "extensions": [
        "+$34.58 for 24 mo",
        "In store"
      ]
    },
    {
      "position": 2,
      "block_position": "top",
      "title": "Apple iPhone 12 - 64GB - Blue - AT&T",
      "price": "$0.00 now",
      "extracted_price": 0,
      "link": "https://www.google.com/aclk?sa=l&ai=DChcSEwjDzrXPivvvAhVn5uMHHftYDnYYABAPGgJ5bQ&sig=AOD64_3UZZEwYJU12HO3fOYyUDEgsZA39Q&ctype=46&q=&ved=0ahUKEwjNkrDPivvvAhVFbKwKHZBTBPsQww8IvwU&adurl=",
      "source": "AT&T",
      "rating": 4.5,
      "reviews": 7551,
      "thumbnail": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcTeVaYnl3jQxS-TAx8Ndgl660NvO500qQZ3bLFTTSGJCQa7XEHPX5GW4I_705PmcdqdudJJ2kcUVFM2Vya3piQowRHxlcgw-FRwEATxa50&usqp=CAE",
      "extensions": [
        "+$26.67 for 30 mo",
        "CURBSIDE PICKUP",
        "Pick up today"
      ]
    },
    {
      "position": 3,
      "block_position": "top",
      "title": "iPhone 12 - 128GB Blue - Unlocked & SIM free - Apple",
      "price": "$879.00",
      "extracted_price": 879,
      "link": "https://www.google.com/aclk?sa=L&ai=DChcSEwjDzrXPivvvAhVn5uMHHftYDnYYABAEGgJ5bQ&sig=AOD64_2Uq5NUIgbWChCVpAsLH9VijMaEow&ctype=5&q=&ved=0ahUKEwjNkrDPivvvAhVFbKwKHZBTBPsQww8IxQU&adurl=",
      "source": "Apple",
      "shipping": "Free shipping",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcRIEcvJHvLlspuWBsa_lt-GrMMZJkYTPIVJzaOacqZse5lwRtSxclzqpSbbxz1nbnaUHLDyXHA28LiLgIP68g-kPgKMHCMs5hrRUAvKPR8C_PXD1bbTBTrtow&usqp=CAE"
    },
    ...
  ...
}

Shopping Results filters with tbs values

To apply filters for the Google Shopping search, you would need to update the tbs parameter with the appropriate value. SerpApi is able to extract and make sense of this type of data.
e.g. To select "Buy on Google" option, you need to pass vw:l,mr:1,cat:404,root_cat:529656,buy:g,ss:67,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D value to tbs parameter.
e.g. To select multiple filter options, tbs parameter has to be constructed in the next sequence: value + : + value.
Shopping Results filters with tbs values

JSON Example

{
  ...
  "filters": [
    {
      "type": "Show only",
      "options": [
        {
          "text": "Buy on Google",
          "tbs": "vw:l,mr:1,cat:404,root_cat:529656,buy:g,ss:67,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        {
          "text": "New items",
          "tbs": "vw:l,mr:1,cat:404,root_cat:529656,new:1,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        }
      ]
    },
    {
      "type": "Price",
      "options": [
        {
          "text": "Up to $400",
          "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_max:400,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        {
          "text": "$400 – $900",
          "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_min:400,ppr_max:900,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        {
          "text": "$900 – $1,500",
          "tbs": "vw:l,mr:1,cat:404,root_cat:529656,price:1,ppr_min:900,ppr_max:1500,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        ...
      ]
    },
    {
      "type": "Category",
      "options": [
        {
          "text": "TVs",
          "tbs": "vw:l,mr:1,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        }
      ]
    },
    {
      "type": "Brand",
      "options": [
        {
          "text": "Samsung",
          "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C709001,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        {
          "text": "LG",
          "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C708995,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        {
          "text": "TCL",
          "tbs": "vw:l,mr:1,root_cat:529656,cat:404,pdtr0:708987%7C761941,init_ar:SgVKAwiUA0oHsgQECPipIA%3D%3D"
        },
        ...
      ]
    },
    ...
  ],
  ...
}