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

Scrape Walmart Product Listings

Search Walmart and extract product names, prices, ratings, and review counts. Walmart's bot detection checks IP reputation and request patterns, so the BQL and Frameworks tabs route through stealth mode and a residential proxy to look like a real US visitor.

Prerequisites

Steps

Selector stability

Walmart updates its markup regularly. If selectors stop returning results, open the page in browser DevTools and inspect the current DOM structure to update them.

Send the BQL mutation over HTTP to the stealth endpoint. No browser library or BQL IDE required.

1. Send the request

curl -X POST \
"https://production-sfo.browserless.io/stealth/bql?token=YOUR_API_TOKEN_HERE&proxy=residential&proxyCountry=us" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation ScrapeWalmart { goto(url: \"https://www.walmart.com/search?q=iphone\", waitUntil: networkIdle) { status } waitForTimeout(time: 3000) { time } products: mapSelector(selector: \"[data-item-id]\") { name: mapSelector(selector: \"[itemprop='\''name'\'']\") { innerText } price: mapSelector(selector: \"[itemprop='\''price'\'']\") { innerText } rating: mapSelector(selector: \"span[itemprop='\''ratingValue'\'']\") { innerText } reviewCount: mapSelector(selector: \"[itemprop='\''ratingCount'\'']\") { innerText } link: mapSelector(selector: \"a[href*='\''\/ip\/'\'']\") { href: attribute(name: \"href\") { value } } } }",
"variables": {},
"operationName": "ScrapeWalmart"
}'

2. Check the output

{
"data": {
"goto": { "status": 200 },
"waitForTimeout": { "time": 3000 },
"products": [
{
"name": [{ "innerText": "Apple iPhone 15, 128GB, Black - Unlocked" }],
"price": [{ "innerText": "$699.00" }],
"rating": [{ "innerText": "4.6" }],
"reviewCount": [{ "innerText": "2847" }],
"link": [{ "href": { "value": "https://www.walmart.com/ip/Apple-iPhone-15/1752657432" } }]
},
{
"name": [{ "innerText": "Apple iPhone 14, 128GB, Midnight - Unlocked" }],
"price": [{ "innerText": "$499.00" }],
"rating": [{ "innerText": "4.5" }],
"reviewCount": [{ "innerText": "5120" }],
"link": [{ "href": { "value": "https://www.walmart.com/ip/Apple-iPhone-14/633586395" } }]
}
]
}
}

Next steps