Skip to content

Google Shopping API

Query Google Shopping and receive structured product listings with price, rating and source.

Endpoint

POST https://serpforai.dev/api/v1/search
GET  https://serpforai.dev/api/v1/search

Authentication is a bearer header carrying your API key:

Authorization: Bearer <userKey>

Set t: "google_shopping". This is one of five Google vertical engines available on this API - see also Google Images, Google Videos, Google Short Videos and Google News. For general web search use the SERP API.

Request parameters

POST requests send JSON; GET requests send the same fields as query parameters.

FieldTypeRequiredDefaultDescription
sstringyes-The search keyword
tstringyes-Must be google_shopping
dnumberno5000Maximum time the API may spend, in milliseconds
countrystringno-ISO 3166-1 alpha-2 country code (e.g. us)
htmlnumberno01 includes the raw result-page HTML alongside data, 0 omits it

There is no p (page) parameter for this engine.

Response

{
  "code": 0,
  "msg": "",
  "data": {
    "id": "q_...",
    "shopping_results": [
      {
        "position": 1,
        "title": "...",
        "product_id": "...",
        "product_link": "https://...",
        "source": "...",
        "price": "$249.00",
        "extracted_price": 249,
        "rating": 4.5,
        "reviews": 978,
        "thumbnail": "https://...",
        "multiple_sources": false,
        "delivery": null
      }
    ]
  }
}
FieldDescription
code0 means success; anything else is a failure
msgHuman readable failure reason, empty on success
data.idOpaque search-session id
data.shopping_results[]Product rows - position, title, product_id, product_link, source, price, extracted_price, rating, reviews, thumbnail, multiple_sources, delivery

rating, reviews and delivery are null when Google does not report them for a listing.

Unlike bing/google, data here is an object, not a bare array - read data.shopping_results, not data directly.

Example

curl -X POST https://serpforai.dev/api/v1/search \
  -H "Authorization: Bearer $SERPFORAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"s":"laptop","t":"google_shopping","country":"us"}'
import httpx

response = httpx.post(
    "https://serpforai.dev/api/v1/search",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"s": "laptop", "t": "google_shopping", "country": "us"},
    timeout=30,
)
payload = response.json()
for row in payload["data"]["shopping_results"]:
    print(row["title"], row["price"])