Google Shopping
Search Google Shopping products.
GET/api/v1/google/shopping
Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.
Parameters
Product search
| Parameter | Type | Description |
|---|---|---|
q | string | Product query, up to 2,048 characters with no controls. Optional when a shoprs token is supplied. |
shoprs | string | Google refinement token from a previous response, up to 4,096 characters. An explicit refinement replaces the one it carries. |
start | integer | Result offset from 0 through 1,000. |
num | integer | 1 through 100. Responses are capped to this count and transparently consume Google’s fixed 40-product pages when needed. |
Refinements and sorting
| Parameter | Type | Description |
|---|---|---|
min_price | number | Lower price bound, 0 through 1,000,000,000. Excludes the other refinements. |
max_price | number | Upper price bound, at or above min_price. Excludes the other refinements. |
sort_by | "" | "1" | "2" | "3" | "4" | Price low to high, price high to low, rating high to low, or Google’s default relevance. Combines with one refinement. |
free_shipping | boolean | Only products with free shipping. Excludes the other refinements.Default: false. |
on_sale | boolean | Only products Google marks as on sale. Excludes the other refinements.Default: false. |
small_business | boolean | Only products from small businesses. Excludes the other refinements.Default: false. |
Geography and localization
| Parameter | Type | Description |
|---|---|---|
location | string | Named search origin, up to 512 characters and 63 UTF-8 bytes once encoded. Conflicts with uule. |
uule | string | Canonical Google location token, up to 2,048 characters. Conflicts with location. |
google_domain | string | Validated first-party Google domain.Default: google.com. |
gl | string | Two-letter country code, normalized to lowercase. |
hl | string | Language code such as en, en-GB, or de. |
device | "desktop" | "tablet" | "mobile" | Google returns its real layout for the selected device.Default: desktop. |
Response
A JSON object with search_metadata (request id, credits used and remaining) and the result groups the page returns. Groups and fields depend on the content of each page, so treat every field as optional.
Examples
cURL
curl "https://serpfast.com/api/v1/google/shopping?q=coffee+maker&num=3&hl=en&gl=us" \
-H "Authorization: Bearer $SERPFAST_KEY"Node.js 18+
const params = new URLSearchParams({
"q": "coffee maker",
"num": 3,
"hl": "en",
"gl": "us"
});
const res = await fetch(`https://serpfast.com/api/v1/google/shopping?${params}`, {
headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);Python
import os, requests
params = {
"q": "coffee maker",
"num": 3,
"hl": "en",
"gl": "us"
}
res = requests.get(
"https://serpfast.com/api/v1/google/shopping",
params=params,
headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
timeout=120,
)
print(res.json())