Google Shopping API

The Google Shopping Results API allows a user to scrape the results of a Google Shopping search. 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.

API Parameters

Search Query

q

Required

Parameter defines the query you want to search. You can use anything that you would use in a regular Google Shopping search. e.g. inurl:, site:, intitle:.

Geographic Location

location

Optional

Parameter defines from where you want the search to originate. If several locations match the location requested, we'll pick the most popular one. Head to the /locations.json API if you need a more precise control. location and uule parameters can't be used together. Avoid utilizing location when setting the location outside the U.S. when using Google Shopping API.

uule

Optional

Parameter is the Google encoded location you want to use for the search. uule and location parameters can't be used together.

Localization

google_domain

Optional

Parameter defines the Google domain to use. It defaults to google.com. Head to the Google domains for a full list of supported Google domains.

gl

Optional

Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France) Head to the Google countries for a full list of supported Google countries.

hl

Optional

Parameter defines the language to use for the Google Maps search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French) Head to the Google languages for a full list of supported Google languages.

Advanced Filters

tbs

Optional

(to be searched) parameter defines advanced search parameters that aren't possible in the regular query field.

Pagination

start

Optional

Parameter defines the result offset. It skips the given number of results. It's used for pagination. (e.g., 0 (default) is the first page of results, 60 is the 2nd page of results, 120 is the 3rd page of results, etc.).

num

Optional

Parameter defines the maximum number of results to return. (e.g., 60 (default) returns 60 results, 40 returns 40 results, and 100 (maximum) returns 100 results).
Any number greater than maximum number (100) will default to 100.
Any number lesser than minimum number (1) will default to 60.

Serpapi Parameters

engine

Required

Set parameter to google_shopping to use the Google Shopping API engine.

device

Optional

Parameter defines the device to use to get the results. It can be set to desktop (default) to use a regular browser, tablet to use a tablet browser (currently using iPads), or mobile to use a mobile browser.

no_cache

Optional

Parameter will force SerpApi to fetch the Google Shopping results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

JSON structure overview

{
  ...
  "filters": [
    {
      "type": "String - Block title (Ex: 'Shipping & returns')",
      "options": [
        {
          "text": "String - Filter name (Ex: 'Free returns')",
          "tbs": "String - tbs value (Ex: 'mr:1,free_return:1')"
        },
        ...
      ]
    },
    ...
  ],
  "inline_shopping_results": [
    {
      "position": "Integer - Item position (Ex: 1)",
      "block_position": "String - Block position on the page. Value can be `top` or `bottom`",
      "title": "String - Item title",
      "price": "String - Item price (Ex : '$14.99')",
      "extracted_price": "Numeric - Item price as a float or integer (Ex: '14.99')".,
      "link": "String - Link to the Google item page",
      "source": "String - Product source name (Ex: 'Black Rifle Coffee Company')",
      "rating": "Numeric - Item rating (Ex: '4.5')",
      "reviews": "Integer - Item review count (Ex: '1200')",
      "extensions": "Array - Item's extensions",
      "thumbnail": "String - Base64 data or URL of an image"
    },
  ],
    ...
  ],
  "shopping_results": [
    {
      "position": "Integer - Item position (Ex: 1)",
      "title": "String - Item title (Ex: 'Ryan's World Youth Headphones')",
      "link": "String - Link to the item",
      "product_id": "String - Unique Google product identifier (Ex: '11809195947618191040')",
      "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 (Ex: 'eBay')",
      "price": "String - Item price (Ex: '$14.95')",
      "extracted_price": "Numeric - Item price as a float or integer (Ex: '14.95')",
      "rating": "Numeric - Item rating (Ex: '5')",
      "reviews": "Integer - Item review count (Ex: '15')",
      "snippet": "String - Item description",
      "extensions": "Array - Item tags/extensions",
      "thumbnail": "String - Base64 data or URL of an image",
      "other_options": "Array - Other Google product variants",
      "tag": "String - Item tag (Ex: 'CURBSIDE', 'IN-STORE PICKUP', 'SALE', or 'FREE 2-DAY')",
      "delivery" : "String - Information on delivery of the product (Ex: '$7.95 delivery')"
    },
    ...
  ],
  ...
}

API Results

JSON Results

JSON output includes structured data for shopping results, inline shopping results and shopping filters results.

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML Results

HTML output is useful to debug JSON results or support features not supported yet by SerpApi.
HTML output gives you the raw HTML results from Google.

Results for  q: MacBook Pro 16"

Results for  q: MacBook Pro 16"

JSON Example

{
  "search_metadata": {
    "id": "61f7a65ae7d08aabb21bb520",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/ef85073bf4277e16/61f7a65ae7d08aabb21bb520.json",
    "created_at": "2022-11-09 14:03:45 UTC",
    "processed_at": "2022-11-09 14:03:46 UTC",
    "google_shopping_url": "https://www.google.com/search?tbm=shop&q=Macbook+M2&oq=Macbook+M2&hl=en&gl=us&num=10&sourceid=chrome&ie=UTF-8",
    "raw_html_file": "https://serpapi.com/searches/ef85073bf4277e16/61f7a65ae7d08aabb21bb520.html",
    "prettify_html_file": "https://serpapi.com/searches/ef85073bf4277e16/61f7a65ae7d08aabb21bb520.prettify",
    "total_time_taken": 2.65
  },
  "search_parameters": {
    "engine": "google_shopping",
    "q": "Macbook M2",
    "location_requested": "Orlando-Daytona Beach-Melbourne FL, FL",
    "location_used": "Orlando-Daytona Beach-Melbourne FL, FL",
    "google_domain": "google.com",
    "hl": "en",
    "gl": "us",
    "device": "desktop"
  },
  "search_information": {
    "shopping_results_state": "Results for exact spelling",
    "query_displayed": "Macbook M2",
        "menu_items": [
      {
        "position": 1,
        "title": "All",
        "link": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&source=lnms&sa=X&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ_AUI5A4oAA",
        "serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2"
      },
      {
        "position": 2,
        "title": "Images",
        "link": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&tbm=isch&source=lnms&sa=X&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ_AUI5Q4oAQ",
        "serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&tbm=isch"
      },
      {
        "position": 3,
        "title": "Maps",
        "link": "https://maps.google.com/maps?hl=en&gl=us&q=Macbook+M2&um=1&ie=UTF-8&sa=X&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ_AUI5g4oAg",
        "serpapi_link": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2"
      },
      {
        "position": 4,
        "title": "Shopping"
      }
    ]
  },
  "filters": [
    {
      "type": "Show only",
      "options": [
        {
          "text": "Buy on Google",
          "tbs": "mr:1,buy:g"
        },
        {
          "text": "Available nearby",
          "tbs": "mr:1,local_avail:1,ss:55"
        },
        {
          "text": "On sale",
          "tbs": "mr:1,sales:1"
        }
      ]
    },
    {
      "type": "Price",
      "options": [
        {
          "text": "Up to $300",
          "tbs": "mr:1,price:1,ppr_max:300"
        },
        {
          "text": "$300 – $600",
          "tbs": "mr:1,price:1,ppr_min:300,ppr_max:600"
        },
        {
          "text": "$600 – $1,000",
          "tbs": "mr:1,price:1,ppr_min:600,ppr_max:1000"
        },
        {
          "text": "Over $1,000",
          "tbs": "mr:1,price:1,ppr_min:1000"
        }
      ]
    },
    {
      "type": "Apple MacBook Product Line",
      "options": [
        {
          "text": "MacBook Pro",
          "tbs": "mr:1,pdtr0:946505%7C946506"
        },
        {
          "text": "MacBook Air",
          "tbs": "mr:1,pdtr0:946505%7C946507"
        },
        {
          "text": "MacBook (Original)",
          "tbs": "mr:1,pdtr0:946505%7C972425"
        }
      ]
    },
    ...
  ],
  "inline_shopping_results": [
    {
      "position": 1,
      "block_position": "top",
      "title": "MacBook Air 13.6″ Laptop - Apple M2 chip - 8GB Memory - 256GB SSD (Latest Model) - Midnight",
      "price": "$1,049.00",
      "extracted_price": 1049,
      "link": "https://www.google.com/aclk?sa=l&ai=DChcSEwijk5-BoqH7AhVJqIYKHV8iDe0YABABGgJ2dQ&sig=AOD64_206eG8rTPVFrzxgf6y0CpdH2pKqQ&ctype=46&q=&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQqygI6BA&adurl=",
      "source": "Best Buy",
      "rating": 5,
      "reviews": 11,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcQvMfIfHD81bj5w2wEFQfgV92123vZEj2jaNRlenMxj0qqIncz3W0z3nhk35LZJkTu-7h3dyGky_nP1YTHGkK-h0svP3DKlk5CMDw6nGVgPPDrkIMXxSJ9ojg&usqp=CAE",
      "extensions": [
        "SALE",
        "Pick up today"
      ]
    },
    {
      "position": 2,
      "block_position": "top",
      "title": "Apple MacBook Air 13.6 inch Laptop - M2 chip - 8GB Memory - 256GB SSD (Latest Model) - Midnight (MLY33LL/A / MLY33)",
      "price": "$1,289.00",
      "extracted_price": 1289,
      "link": "https://www.google.com/aclk?sa=l&ai=DChcSEwijk5-BoqH7AhVJqIYKHV8iDe0YABADGgJ2dQ&sig=AOD64_2SirHJWCiWW_xEZzde6of5H2FmbA&ctype=5&q=&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQww8I7RA&adurl=",
      "source": "Electronic Express",
      "shipping": "Free shipping",
      "rating": 5,
      "reviews": 722,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcTBRrvCiIntutU2GNwlRtYIFJN-MVGI0iOI7ra_tLUjisbTQ28HuySOoC4WZd0y5ot_pvPpjmHLhpbo5KZrYQPq0Y7qjiQ2ehNEBqsMkvs&usqp=CAE"
    },
    {
      "position": 3,
      "block_position": "top",
      "title": "MacBook Pro 13.3″ Laptop - Apple M2 chip - 8GB Memory - 256GB SSD (Latest Model) - Space Gray",
      "price": "$1,149.00",
      "extracted_price": 1149,
      "link": "https://www.google.com/aclk?sa=l&ai=DChcSEwijk5-BoqH7AhVJqIYKHV8iDe0YABAFGgJ2dQ&sig=AOD64_3wFjAuvkke_OCbk8c3N1ofeOQBxw&ctype=46&q=&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQqygI8RA&adurl=",
      "source": "Best Buy",
      "rating": 5,
      "reviews": 11517,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcR-DuuQAa8KQ83T_2l_7PdNDxP9FjG6VXpkoLYzphNUk4HfE1rGEdqLPCvVo1_M-3-hdWg_v-xhYU9IyQHIRZJlFYESzfW5JVqCuinii3I&usqp=CAE",
      "extensions": [
        "SALE",
        "Pick up today"
      ]
    },
    ...
  ],  
  "shopping_results": [
    {
      "position": 1,
      "title": "MacBook Air M2 - 8GB Ram, 256GB SSD - Midnight - Apple",
      "link": "https://www.google.com/url?url=https://www.bestbuy.com/site/macbook-air-13-6-laptop-apple-m2-chip-8gb-memory-256gb-ssd-latest-model-midnight/6509650.p%3FskuId%3D6509650%26ref%3D212%26loc%3D1%26extStoreId%3D1530&rct=j&q=&esrc=s&sa=U&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ_uQECO0R&usg=AOvVaw05N5JBb_KzmaaMEWn8aYu2",
      "product_link": "https://www.google.com/shopping/product/4038444917756773029",
      "product_id": "4038444917756773029",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&product_id=4038444917756773029",
      "source": "Best Buy",
      "price": "$1,049.00",
      "extracted_price": 1049,
      "old_price": "$1,199.00",
      "extracted_old_price": 1199,
      "rating": 4.8,
      "reviews": 722,
      "extensions": [
        "Mac OS",
        "Octa Core",
        "USB-C"
      ],
      "badge": "Trusted Store",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcTYeih9quJoMjkWynU7heCxSGDchIXe9_jQ4KNCqFFkpROPGxsff0uaNfRB23_-AFAh3SBvDMMrj3R1mjXQLhUd4qOrhaQwuydr7yb57wU&usqp=CAE",
      "delivery": "133.4 mi · In stock · Curbside"
    },
    {
      "position": 2,
      "title": "Apple MacBook Air M2 13.6″ - 8GB Ram, 256GB SSD - Space Gray",
      "link": "https://www.google.com/url?url=https://www.apple.com/us/shop/go/product/MLXW3%3Fcid%3Daos-us-seo-pla&rct=j&q=&esrc=s&sa=U&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQguUECJAS&usg=AOvVaw0sziB4jnxpW4srD3nRuEih",
      "product_link": "https://www.google.com/shopping/product/14753408626662104365",
      "product_id": "14753408626662104365",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&product_id=14753408626662104365",
      "source": "Apple",
      "price": "$1,199.00",
      "extracted_price": 1199,
      "rating": 4.8,
      "reviews": 11517,
      "extensions": [
        "Mac OS",
        "Octa Core",
        "USB-C",
        "FREE 1-DAY"
      ],
      "badge": "Trusted store",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcQboUZQuh4Uj2lUbSoEcA2zt4B9gTq0mgATBhCk_0gx-v12QUUB8PbJDAorChJZghG54t68U4gXwPEGH34-HjnG-Xig8UYVVc8-BubcUFI&usqp=CAE",
      "tag": "FREE 1-DAY",
      "delivery": "Free delivery by tomorrow & Free 14-day returns"
    },
    {
      "position": 3,
      "title": "Apple - MacBook Pro 13″ M2 Chip 8GB Ram 256GB SSD Space Gray",
      "link": "https://www.google.com/url?url=https://www.brandsmartusa.com/apple/254288/apple-13-3-macbook-pro-256gb-m2.htm&rct=j&q=&esrc=s&sa=U&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQguUECKYS&usg=AOvVaw1Fs8b9ErQvN0ACQIjWUKcG",
      "product_link": "https://www.google.com/shopping/product/10818728628057643970",
      "product_id": "10818728628057643970",
      "serpapi_product_api": "https://serpapi.com/search.json?device=desktop&engine=google_product&gl=us&google_domain=google.com&hl=en&product_id=10818728628057643970",
      "source": "BrandsMart USA",
      "price": "$1,149.00",
      "extracted_price": 1149,
      "rating": 4.8,
      "reviews": 11517,
      "extensions": [
        "Mac OS",
        "Octa Core",
        "USB-C"
      ],
      "thumbnail": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcStHHIeHckMl-QMNVdAtPeKRj1rH0BoC9ZBzrsj1nuKvN6QLZmlO2RKYFzhYgKC6sFmd1ZNTWOm6Q9F1apy84VoGGSLcPg4UEuaf1NYtcA&usqp=CAE",
      "delivery": "Delivery by Wed, Nov 16"
    },
    ...
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&tbs=vw:d&tbm=shop&ei=RLNrY6_9F5-JwbkPhL2dyAI&start=60&sa=N&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ8NMDCJId",
    "other_pages": {
      "2": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&tbs=vw:d&tbm=shop&ei=RLNrY6_9F5-JwbkPhL2dyAI&start=60&sa=N&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ8tMDCIQd",
      "3": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&tbs=vw:d&tbm=shop&ei=RLNrY6_9F5-JwbkPhL2dyAI&start=120&sa=N&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ8tMDCIYd",
      "4": "https://www.google.com/search?q=Macbook+M2&hl=en&gl=us&tbs=vw:d&tbm=shop&ei=RLNrY6_9F5-JwbkPhL2dyAI&start=180&sa=N&ved=0ahUKEwivr5mBoqH7AhWfRDABHYReBykQ8tMDCIgd",
      ...
    }
  },
  "serpapi_pagination": {
    "current": 1,
    "next_link": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&start=60&tbm=shop&tbs=vw%3Ad",
    "next": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&start=60&tbm=shop&tbs=vw%3Ad",
    "other_pages": {
      "2": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&start=60&tbm=shop&tbs=vw%3Ad",
      "3": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&start=120&tbm=shop&tbs=vw%3Ad",
      "4": "https://serpapi.com/search.json?device=desktop&engine=google_shopping&gl=us&google_domain=google.com&hl=en&num=10&q=Macbook+M2&start=180&tbm=shop&tbs=vw%3Ad",
      ...
    }
  }
}