~ / endpoints / Grocery API

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.

Get a free API keyBrowse the endpoints
1,000
free requests / mo
2.6s
median response
JSON
structured output
40+
results per page

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
curl "https://api.walmartscraperapi.com/api/v1/walmart/search?query=great+value+milk&api_key=$API_KEY"
Python
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

200 OK
{
  "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 }
    }
  ]
}
FieldTypeDescription
querystringThe grocery search term echoed back for this response.
total_resultsintegerNumber of items returned on this page.
resultsarrayThe ranked grocery grid, each item an object with the fields below.
results[].idstringThe stable Walmart us_item_id for the grocery listing.
results[].titlestringThe item title, e.g. the brand, size, and pack count.
results[].pricenumberCurrent price parsed from the listing.
results[].price_per_unitobjectThe 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[].ratingnumberAverage star rating, when the item has reviews.

Params

ParameterRequiredDefaultNotes
queryrequired-The grocery search term, e.g. great value milk. This is the required input; we build the Walmart search URL from it.
pageoptional1Results page number, 1 to 100. Defaults to 1.
countryoptional-Optional two-letter country code to fetch results as seen from that region.
api_keyrequired-Your API key, passed as a query parameter. Get one free at signup.

Use it for

>

Grocery price tracking

Run staple grocery queries on a schedule and store price and price_per_unit to watch how everyday item costs move over time.
>

Unit-price comparison

Read the price_per_unit line to compare cost per ounce or per count across pack sizes and brands for the same item.
>

Inflation and basket indexes

Track a fixed basket of grocery items to build your own cost-of-goods or inflation index from real Walmart prices.
>

Assortment monitoring

Pull a grocery category to see which brands and private-label items appear and where an assortment has gaps.

Pricing

PlanPriceBest for
Free1,000 requestsTesting and small jobs
Pro$0.60 / 1kProduction workloads
Pay-as-you-go$0.90 / 1kSpiky 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.

Get grocery api as JSON
Free plan, 1,000 requests. No credit card required.
Get a free API key All endpoints