Walmart Grocery Scraper API
Our Walmart grocery scraper takes any grocery query and returns the product grid as JSON: title, price, the price-per-unit line, rating, seller, and stock status, so you can track grocery and household items without scraping the page yourself.
Why it is hard
Walmart's grocery aisle is a client-rendered search grid behind a residential-only wall, so a datacenter fetch returns a robot check instead of items. Prices, unit prices, and stock live in a shifting __NEXT_DATA__ blob, so a hand-built grocery parser breaks within weeks.
Quickstart
curl "https://api.walmartscraperapi.com/api/v1/walmart/search?query=great+value+milk&api_key=$API_KEY" import requests
BASE = "https://api.walmartscraperapi.com"
API_KEY = "YOUR_API_KEY"
# Grocery items come back from the search endpoint. Pass a grocery query.
data = requests.get(
f"{BASE}/api/v1/walmart/search",
params={
"query": "great value milk",
"api_key": API_KEY,
},
timeout=30,
).json()
for r in data["results"]:
unit = r["price_per_unit"].get("amount", r["price_per_unit"]["unit"])
stock = "out of stock" if r["out_of_stock"] else "in stock"
print(r["price"], "(", unit, ")", stock, r["title"]) Response
{
"query": "coffee maker",
"page": 1,
"total_results": 60,
"results": [
{
"position": 1,
"id": "808715278",
"title": "Cuisinart Stainless Steel 12-Cup Coffee Maker, Black",
"url": "https://www.walmart.com/ip/Cuisinart-12-Cup-Coffeemaker-Stainless-Steel-Black/808715278?classType=REGULAR",
"price": 69.95,
"currency": "USD",
"rating": 4.5,
"reviews_count": 4721,
"seller": "Walmart.com",
"out_of_stock": false,
"sponsored": true,
"free_shipping": true,
"free_shipping_with_walmart_plus": true,
"two_day_shipping": false,
"multiple_options_available": false,
"shipping_price": null,
"price_per_unit": { "unit": "each" },
"primary_offer": { "offer_price": 69.95, "was_price": null, "min_price": 0 }
}
]
} | Field | Type | Description |
|---|---|---|
query | string | The grocery search term echoed back for this response. |
total_results | integer | Number of items returned on this page. |
results | array | The ranked grocery grid, each item an object with the fields below. |
results[].id | string | The stable Walmart us_item_id for the grocery listing. |
results[].title | string | The item title, e.g. the brand, size, and pack count. |
results[].price | number | Current price parsed from the listing. |
results[].price_per_unit | object | The unit the price is quoted per (e.g. each), with the unit-price amount string when Walmart shows one (e.g. per oz or per 100 ct). |
results[].rating | number | Average star rating, when the item has reviews. |
Params
| Parameter | Required | Default | Notes |
|---|---|---|---|
query | required | - | The grocery search term, e.g. great value milk. This is the required input; we build the Walmart search URL from it. |
page | optional | 1 | Results page number, 1 to 100. Defaults to 1. |
country | optional | - | Optional two-letter country code to fetch results as seen from that region. |
api_key | required | - | Your API key, passed as a query parameter. Get one free at signup. |
Use it for
Grocery price tracking
Unit-price comparison
Inflation and basket indexes
Assortment monitoring
Pricing
| Plan | Price | Best for |
|---|---|---|
| Free | 1,000 requests | Testing and small jobs |
| Pro | $0.60 / 1k | Production workloads |
| Pay-as-you-go | $0.90 / 1k | Spiky or one-off volume |
Median response 2.6s. You only pay for successful requests.
FAQ
What is a Walmart grocery scraper?
A Walmart grocery scraper is a tool that reads Walmart's public grocery listings and returns them in a structured format. Our Walmart grocery scraper API uses the search endpoint: pass a grocery query and it returns each item's title, price, price-per-unit line, rating, review count, seller, and stock status as JSON.
How do I scrape Walmart grocery prices?
Send a GET request to our walmart/search endpoint with a grocery query (for example great value milk) plus your API key. The response is a ranked grid of items with price and price_per_unit for each, so you read the prices directly and, to track them over time, store each reading with a timestamp on your side.
Can I get the price per unit for grocery items?
Yes, when Walmart displays it. Each result includes a price_per_unit object with the unit the price is quoted per, such as each, plus the unit-price amount string (for example per ounce or per 100 count) when the listing shows one. That lets you compare cost across different pack sizes and brands without doing the math yourself.
Does the grocery endpoint use a different API than search?
No. Grocery and household items are returned by the same walmart/search endpoint, because on Walmart they are found through the same search grid. You pass a grocery query and get the standard result objects back. This page frames that endpoint for grocery use; the fields are identical to a general product search.
Why does scraping Walmart grocery directly fail?
Walmart blocks datacenter IP ranges and renders the grocery grid client-side inside its __NEXT_DATA__ JSON, so a direct fetch from a cloud server usually returns a challenge screen rather than the items. Our API routes through residential IPs, handles the anti-bot layer, and parses that JSON, which is why it returns structured grocery data where a plain request does not.
How fast is the Walmart grocery scraper API?
Median end-to-end response is about 2.6 seconds, which includes residential proxy routing, anti-bot handling, retries, and parsing. One call returns a full page of grocery results, so you do not chain extra requests to assemble the grid.