Google Shopping API
Google Shopping API uses /api/v1/search?engine=google_shopping
API endpoint to scrape real-time results.
The new Google Shopping layout is opt-in and is only triggered when value of gl
is either of us
, au
, ca
, tk
, nf
, nz
, hm
, cx
, or cc
and hl=en
are explicitly specified. This layout introduces several changes in the API's behavior and response structure, detailed below.
Changelog (New vs Old Layout)
- [BREAKING] The
tbs
request parameter is no longer supported; use the newshoprs
parameter for custom filters or apply filters directly in the search query. - [BREAKING] The
sort_by
andnum
request parameters are no longer supported. - [BREAKING] The
featured_results
,related_results
,nearby_results
,categories
, andrelated_searches
top keys are no longer supported. - [NEW] Introduced
popular_products
as a replacement for thefeatured_results
top key. - [NEW] Added support for the
shopping_results.delivery_return
andshopping_results.snippet
keys. - [UPDATED] The
price_min
,price_max
, andcondition
request parameters are now supported via keywords in the search query. - [UPDATED] The
shopping_ads.durability
key is nowshopping_ads.condition
, andshopping_results.durability
is nowshopping_results.condition
.
API Parameters
Search Query
-
- Name
-
q
- Required
- Required
- Description
-
Defines the query you want to search, similar to a regular Google search. In the new Google Shopping layout, many filters are embedded directly into the search query. Here are some examples of how you can use it:
- Search by price:
tshirt under $30
,skinny fit kids jeans between $15 and $30
,charizard over $300
. - Search by size:
mens size 8.5 nike air
. - Search by color:
Playstation white
. - Search nearby stores:
Apparel nearby
. - Search by condition:
iphone used
,macbook new
. - Search by brand:
prada dress
,gucci shoes
. - Search discounted products:
laptop on sale
,headphones on sale
.
- Search by price:
Localization
-
- Name
-
google_domain
- Required
- Optional
- Description
-
Defines the Google domain for the search. The default is
google.com
. Check the full list of supported Googlegoogle_domain
domains.
-
- Name
-
gl
- Required
- Optional
- Description
-
Only triggers the new layout when
gl
is one ofus
,au
,ca
,tk
,nf
,nz
,hm
,cx
, orcc
. Other values will trigger the old layout. Check the full list of supported Googlegl
countries.
-
- Name
-
hl
- Required
- Optional
- Description
-
Only triggers the new layout with
hl=en
. Other values will trigger the old layout. Check the full list of supported Googlehl
languages.
Geographic Location
-
- Name
-
location
- Required
- Optional
- Description
-
Defines from where you want the search to originate. If several locations match the requested location, the most popular one is selected. Head to the Locations API for more precise control.
-
- Name
-
uule
- Required
- Optional
- Description
-
Defines the Google encoded location for the search. SearchApi automatically generates the
uule
parameter when thelocation
parameter is used, but it can be overwritten directly.uule
andlocation
cannot be used together.
Filters
-
- Name
-
shoprs
- Required
- Optional
- Description
-
Restricts results to URLs based on encoded values. For example,
CAEYFyoDcHM1MhwIFxISUHJpY2U6IGxvdyB0byBoaWdoKgQQARgBYAKIAQE
would sort products by price: low to high.
-
- Name
-
price_min
- Required
- Optional
- Description
-
Defines the minimum price of the products returned. For example, a value of
100
would return products with a minimum price of $100.
-
- Name
-
price_max
- Required
- Optional
- Description
-
Defines the maximum price of the products returned. For example, a value of
2.50
would return products with a maximum price of $2.50.
-
- Name
-
condition
- Required
- Optional
- Description
-
Filters product condition. Options include:
new
for new products, andused
for used items.
Pagination
-
- Name
-
page
- Required
- Optional
- Description
-
Indicates which page of results to return. The default is
1
.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Defines the engine that will be used to retrieve real-time data. It must be set to
google_shopping
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
Authenticates your requests. Use it as a query parameter (
https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=google_shopping&gl=us&hl=en&location=California%2CUnited+States&q=PS5
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_shopping",
"q": "PS5",
"gl": "us",
"hl": "en",
"location": "California,United States"
}
response = requests.get(url, params = params)
print(response.text)
{
"search_metadata": {
"id": "search_Rrb28K9xoXv9c0jPpzE1BA7Q",
"status": "Success",
"created_at": "2024-07-12T16:54:48Z",
"request_time_taken": 2.48,
"parsing_time_taken": 0.02,
"total_time_taken": 2.5,
"request_url": "https://www.google.com/search?q=PS5&oq=PS5&gl=us&hl=en&tbm=shop&num=60&uule=w+CAIQICIYQ2FsaWZvcm5pYSxVbml0ZWQgU3RhdGVz&ie=UTF-8",
"html_url": "https://www.searchapi.io/api/v1/searches/search_Rrb28K9xoXv9c0jPpzE1BA7Q.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_Rrb28K9xoXv9c0jPpzE1BA7Q"
},
"search_parameters": {
"engine": "google_shopping",
"q": "PS5",
"location": "California,United States",
"location_used": "California,United States",
"google_domain": "google.com",
"hl": "en",
"gl": "us"
},
"search_information": {
"query_displayed": "PS5"
},
"filters": [
{
"type": "Sort by",
"options": [
{
"text": "Price: low to high",
"shoprs": "CAEYFyoDcHM1MhwIFxISUHJpY2U6IGxvdyB0byBoaWdoKgQQARgBYAKIAQE"
},
{
"text": "Price: high to low",
"shoprs": "CAEYFyoDcHM1MhwIFxISUHJpY2U6IGhpZ2ggdG8gbG93KgQQARgBYAKIAQI"
}
]
},
{
"type": "Category",
"options": [
{
"text": "PlayStation Controllers",
"shoprs": "CAEYCSoDcHM1MhsICRIXUGxheVN0YXRpb24gQ29udHJvbGxlcnNgAg"
},
...
]
},
...
],
"shopping_ads": [
{
"position": 1,
"block_position": "top",
"title": "Playstation 5 Digital Console Slim - Marvel's Spider-Man 2 Bundle, White",
"seller": "Walmart",
"link": "https://www.walmart.com/ip/Playstation-5-Digital-Console-Slim-Marvel-s-Spider-Man-2-Bundle/5395472295?wmlspartner=wlpa&selectedSellerId=147",
"price": "$459.99",
"extracted_price": 459.99,
"rating": 4.7,
"reviews": 5000,
"image": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcQMIFNwj3G5eCHTg3cDhtbveRuICQVC2F5Hp4vzkuGwqGS0gRic26FjqmIhjqAvFNnKXHFtvp5h7sogvM-UGHGy4ww590e3GGBzQ2RxAgJ0WSy9ujZSUe4MGiCDbi49BYFuRVR0xA&usqp=CAc"
},
...
],
"shopping_results": [
{
"position": 1,
"product_id": "8039622388823297908",
"title": "Sony Playstation 5 Digital",
"product_link": "https://www.google.com/shopping/product/8039622388823297908?gl=us&hl=en",
"seller": "GameStop",
"offers": "3+",
"extracted_offers": 3,
"offers_link": "https://www.google.com/shopping/product/8039622388823297908/offers?gl=us&hl=en&uule=w+CAIQICIYQ2FsaWZvcm5pYSxVbml0ZWQgU3RhdGVz",
"price": "$429.99",
"extracted_price": 429.99,
"rating": 4.4,
"reviews": 9400,
"delivery": "Free by 7/16",
"durability": "Pre-owned",
"thumbnail": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcT7iEgHamefjZlmViMlw1HwT0rpjGuX9D_SOcC7o-iehd5IVtjFKnUzgvYJkm7FGtnn9DJkEIWvcGpuzgZ9p9PeBroASb7-8peYCh4cdM0"
},
{
"position": 2,
"product_id": "1974369455608953604",
"title": "Sony PlayStation 5 Slim Digital Edition",
"product_link": "https://www.google.com/shopping/product/1974369455608953604?gl=us&hl=en",
"seller": "Best Buy",
"offers_link": "https://www.google.com/shopping/product/1974369455608953604/offers?gl=us&hl=en&uule=w+CAIQICIYQ2FsaWZvcm5pYSxVbml0ZWQgU3RhdGVz",
"price": "$449.99",
"extracted_price": 449.99,
"rating": 4.7,
"reviews": 5100,
"delivery": "Free by 7/22",
"thumbnail": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcR193EMoXfZ3IcsqbqK4fNa18yFocxhmu1L4Ihn8RLrKE72rGXNH-6CYp01knQYIPrqPIUWYPKk32OhIKtcVevPwSIZ68v_b5DRblpJ_dPQfidUDFp-lupA"
},
...
]
}
Shopping Results
https://www.searchapi.io/api/v1/search?engine=google_shopping&gl=us&hl=en&location=New+York%2CUnited+States&q=Iphone
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_shopping",
"q": "Iphone",
"gl": "us",
"hl": "en",
"location": "New York,United States"
}
response = requests.get(url, params = params)
print(response.text)
{
"shopping_results": [
{
"position": 1,
"product_id": "5458859202991111437",
"title": "Apple iPhone 15 Pro Max",
"product_link": "https://www.google.com/shopping/product/5458859202991111437?gl=us&hl=en",
"seller": "T-Mobile",
"offers": "10+",
"extracted_offers": 10,
"offers_link": "https://www.google.com/shopping/product/5458859202991111437/offers?gl=us&hl=en&uule=w+CAIQICIYQ2FsaWZvcm5pYSxVbml0ZWQgU3RhdGVz",
"price": "$399.99 now",
"extracted_price": 399.99,
"installment": {
"down_payment": "$399.99 now",
"extracted_down_payment": 399.99,
"months": "24",
"extracted_months": 24,
"cost_per_month": "$50/mo",
"extracted_cost_per_moth": 50
},
"rating": 4.5,
"reviews": 17000,
"delivery": "Free delivery",
"thumbnail": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcSWca-hAFk02X8lJn-3ez8iBbjWOmUNt5RZ_5EwGXt5sCHUix-srIxGmqUuBKcZgH-x_wqfG6Md6qjJ_TaXh5ZbEUkYT0Yc7o7e9I2EbpuIze1Eg7M3b6w1Uw"
},
{
"position": 2,
"product_id": "7331432931378973146",
"title": "Apple iPhone 13 128GB Blue Verizon",
"product_link": "https://www.google.com/shopping/product/7331432931378973146?gl=us&hl=en",
"seller": "Walmart",
"offers": "2+",
"extracted_offers": 2,
"offers_link": "https://www.google.com/shopping/product/7331432931378973146/offers?gl=us&hl=en&uule=w+CAIQICIYQ2FsaWZvcm5pYSxVbml0ZWQgU3RhdGVz",
"installment": {
"months": "24",
"extracted_months": 24,
"cost_per_month": "$790.09/mo",
"extracted_cost_per_moth": 790.09
},
"rating": 4.2,
"reviews": 5100,
"thumbnail": "https://encrypted-tbn2.gstatic.com/shopping?q=tbn:ANd9GcScWFIF4RHZBie3OLNKIgnbe09jQ7EyHA8xwAGnYHQSh4oZ1bv_tajbb6NOYhFbSUk6HlnUqu53oO4UncXois4V-4ihMof2TuByBm2LbAYgMSJz7SoSNFvFAg"
},
...
]
}
Popular Products
https://www.searchapi.io/api/v1/search?engine=google_shopping&gl=us&hl=en&location=New+York%2CUnited+States&q=Lenovo
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_shopping",
"q": "Lenovo",
"gl": "us",
"hl": "en",
"location": "New York,United States"
}
response = requests.get(url, params = params)
print(response.text)
"popular_products": [
{
"position": 1,
"product_id": "12662605563035131269",
"title": "Lenovo Tab M8 4th Gen",
"product_link": "https://www.google.com/shopping/product/12662605563035131269?gl=us&hl=en",
"seller": "Lenovo",
"offers": "10+",
"extracted_offers": 10,
"offers_link": "https://www.google.com/shopping/product/12662605563035131269/offers?gl=us&hl=en&uule=w+CAIQICIWTmV3IFlvcmssVW5pdGVkIFN0YXRlcw",
"price": "$85.49",
"extracted_price": 85.49,
"original_price": "$100",
"extracted_original_price": 100.0,
"rating": 4.3,
"reviews": 959,
"tag": "14% OFF",
"delivery": "Free delivery",
"thumbnail": "https://encrypted-tbn2.gstatic.com/shopping?q=tbn:ANd9GcTJsI5xtfkZtIgEVeSbuLr0W2SLAUrqx-ggbQhAlFLy2dqXvToE-7c5Rcwv_XhTu7T6RqDPO3_GirH5aHBWvoQ6ikOR2O2w9YfkAc9Wcso"
},
...
]
Shopping Ads
https://www.searchapi.io/api/v1/search?engine=google_shopping&gl=us&hl=en&location=California%2CUnited+States&q=Android
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_shopping",
"q": "Android",
"gl": "us",
"hl": "en",
"location": "California,United States"
}
response = requests.get(url, params = params)
print(response.text)
{
"shopping_ads": [
{
"position": 1,
"block_position": "top",
"title": "TCL TAB 8 LE (with 24 monthly payments + plan)",
"seller": "T-Mobile",
"link": "https://www.t-mobile.com/tablet/tcl-tab-8-le?sku=610214676276",
"price": "$0.00 now",
"extracted_price": 0,
"installment": {
"down_payment": "$0.00 now",
"extracted_down_payment": 0,
"months": "24",
"extracted_months": 24,
"cost_per_month": "$7.00/mo",
"extracted_cost_per_moth": 7
},
"image": "https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcTEIfd7wek01FCqKnd7jj-7XbCJ2oBkkyNghqsAOITDqSucGCkSPgydPRKAAT1SGAjs_8pw4U_LsyZLey_z68o5NbHn-xiMl_Bbe-Qd7eORPHn7iUTWmufqNUekoxC6oc97fsCZb1lTC-0&usqp=CAc"
},
...
]
}
Filters
https://www.searchapi.io/api/v1/search?engine=google_shopping&gl=us&hl=en&location=Washington%2CUnited+States&q=Shoes
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_shopping",
"q": "Shoes",
"gl": "us",
"hl": "en",
"location": "Washington,United States"
}
response = requests.get(url, params = params)
print(response.text)
{
"filters": [
{
"type": "Sort by",
"options": [
{
"text": "Price: low to high",
"shoprs": "CAEYFyoFc2hvZXMyHAgXEhJQcmljZTogbG93IHRvIGhpZ2gqBBABGAFgAogBAQ"
},
{
"text": "Price: high to low",
"shoprs": "CAEYFyoFc2hvZXMyHAgXEhJQcmljZTogaGlnaCB0byBsb3cqBBABGAFgAogBAg"
}
]
},
{
"type": "Department",
"options": [
{
"text": "Men's",
"shoprs": "CAEYASoFc2hvZXMyFQgBEgVNZW4nczoKCICjPhCBoz4wBVjmpyBgAg"
},
...
]
},
...
]
}