For AI agents: a documentation index is available at /llms.txt
Skip to main content

Scrape Google Shopping Results

Query Google Shopping and pull product names, prices, and links out of the results page. Google aggressively detects bots on this surface, so your approach matters. The REST tab is quick to try but prone to CAPTCHAs; the Frameworks and BQL tabs pair stealth mode with a residential proxy to look like a real user.

Prerequisites

Steps

Send the product grid selectors to the /scrape endpoint and get back matched text and position data. No browser code required.

note

Google Shopping runs bot detection that can serve a CAPTCHA or return an empty grid to automated requests. If you get incomplete results here, switch to the BQL tab, which routes through stealth mode and residential proxies to avoid that detection.

View Full Code on GitHub

1. Send the request

div.sh-dgr__grid-result h4 holds the product title; .a8Pemb holds the price Google renders inside each card:

curl -X POST \
"https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.google.com/search?q=board+games&tbm=shop",
"elements": [
{ "selector": "div.sh-dgr__grid-result h4" },
{ "selector": "div.sh-dgr__grid-result .a8Pemb" }
]
}'

2. Check the output

The response groups results by selector. Each entry in results gives you the element's text, its rendered dimensions, and its position on the page. This is useful if you need to verify the right element matched:

{
"data": [
{
"selector": "div.sh-dgr__grid-result h4",
"results": [
{
"text": "Catan Board Game",
"html": "Catan Board Game",
"height": 20,
"left": 16,
"top": 220,
"width": 180
}
]
},
{
"selector": "div.sh-dgr__grid-result .a8Pemb",
"results": [
{
"text": "$44.99",
"html": "$44.99",
"height": 16,
"left": 16,
"top": 280,
"width": 60
}
]
}
]
}

Next steps