Dokumentasi API tersedia dalam bahasa Inggris.

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

ParameterTypeDescription
qstringProduct query, up to 2,048 characters with no controls. Optional when a shoprs token is supplied.
shoprsstringGoogle refinement token from a previous response, up to 4,096 characters. An explicit refinement replaces the one it carries.
startintegerResult offset from 0 through 1,000.
numinteger1 through 100. Responses are capped to this count and transparently consume Google’s fixed 40-product pages when needed.

Refinements and sorting

ParameterTypeDescription
min_pricenumberLower price bound, 0 through 1,000,000,000. Excludes the other refinements.
max_pricenumberUpper 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_shippingbooleanOnly products with free shipping. Excludes the other refinements.Default: false.
on_salebooleanOnly products Google marks as on sale. Excludes the other refinements.Default: false.
small_businessbooleanOnly products from small businesses. Excludes the other refinements.Default: false.

Geography and localization

ParameterTypeDescription
locationstringNamed search origin, up to 512 characters and 63 UTF-8 bytes once encoded. Conflicts with uule.
uulestringCanonical Google location token, up to 2,048 characters. Conflicts with location.
google_domainstringValidated first-party Google domain.Default: google.com.
glstringTwo-letter country code, normalized to lowercase.
hlstringLanguage 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())