Blog

Walmart scraper API: get Walmart product data as JSON, with a Python example

Scrape Walmart search and product pages as JSON: price, original price, rating, reviews, seller, GTIN and images, with a tested Python script that saves a CSV.

Published

A Walmart scraper is any program that reads Walmart's public pages and turns them into data: the title, price, original price, rating, review count, seller and identifiers of each product. You can write one yourself with an HTTP client and an HTML parser, or you can call a Walmart scraper API that returns the same fields as JSON and keeps up with page changes for you.

This guide covers the second route. It shows what a Walmart search and a Walmart product page return as data, using real requests made on 16 November 2026 against walmart.com, then gives a tested Python script of about 80 lines that searches Walmart, reads each product page and saves the results to a CSV file. It ends with the things to check in Walmart data before you rely on it, and a checklist for choosing a Walmart scraper.

What does "Walmart scraper" mean?

The phrase covers three things that are often mixed up:

Route What you build What you maintain
Your own scraper An HTTP client, an HTML parser and the code that pulls each field out of the page Request handling, retries, parsing and every change Walmart makes to its pages
A Walmart scraper API Calls to one endpoint that take a keyword or a product URL Only your own code; the provider keeps the extraction working
An agent tool (MCP) Nothing; your AI agent calls the tool when you ask in plain language Nothing; you check the answers the agent gives

Building your own is a reasonable choice for a one-off pull of a few pages. It gets expensive when you need it to keep working every day, because a Walmart product page carries its data in a large embedded JSON block, and a scraper that reads it has to be updated whenever that structure changes.

The rest of this guide uses datawebot, which reads Walmart search and product pages on walmart.com in the United States and returns them as JSON, over REST for your code or MCP for your agent.

A search takes a keyword and returns the products on the Walmart results page, in page order. On 16 November 2026 at 06:29 UTC, a search for "air fryer" on walmart.com returned 10 products and took 22 seconds. Five sponsored listings came back as well, in a separate sponsored list, so ads never mix into the organic results you compare.

Each result carries these fields:

Field Example from the run
title Gourmia All-in-One 14-Quart Air Fryer, Oven, Rotisserie, Dehydrator with Temperature Probe, New
price {"amount": 55, "currency": "USD", "text": "$55.00"}
original_price {"amount": 129, "currency": "USD", "text": "$129.00"}, the struck-through price
rating 4.5
review_count 8,596
availability in_stock
url The product page, ending in its Walmart item ID (5466948866)
image_url The listing's main image
product_id An ID you pass to the product read for the full record

Unlike some marketplaces, Walmart search results carry the review count as well as the rating, so a search alone is enough to rank products by rating and number of reviews. For the seller, brand, identifiers and full image set, you read the product page.

A search reads one Walmart results page. The endpoint can read the first or second page of a search URL you give it, and it does not apply Walmart's filters or sorting, so build your keyword to be specific.

What can you get from a Walmart product page?

A product read takes one Walmart product page (a walmart.com/ip/ URL, or the product_id from a search) and returns the full record. Here is the read of the Gourmia air fryer from the search above, made on 16 November 2026 at 06:29 UTC:

Field Value
title Gourmia All-in-One 14-Quart Air Fryer, Oven, Rotisserie, Dehydrator with Temperature Probe, New
price USD 55
original_price USD 129
details.discount_label SAVE $74.00
rating 4.5
review_count 8,596
details.brand Gourmia
details.category_path Home › Appliances › Kitchen Appliances › Fryers › Air Fryers › Gourmia Air Fryers
details.identifiers Walmart item ID 5466948866, GTIN 810002865572, MPN GAF1290
details.seller Walmart.com, type official
details.images 11 image URLs
details.specs_raw Name and value pairs from the specifications table, such as Volume capacity: 14 qt and Watts: 1750 Watts

The GTIN is the field that makes Walmart data easy to join with other stores: it is the product's barcode number, the same wherever the product is sold, so you can match a Walmart listing to the same product on Amazon or another store without comparing titles. Our guide to product matching covers how to do that across stores.

The seller tells you who sells the listing. type: "official" means Walmart itself; a third-party seller on Walmart's marketplace comes back with type: "marketplace", its own name and a link to its seller page.

For how Walmart's item IDs, seller offers and fulfilment options relate to each other, see our guide to Walmart product data.

How do you scrape Walmart with Python?

The script below does the full job in one run: it searches Walmart for a keyword, reads each organic result's product page and writes one CSV row per product. It uses the standard library only and needs Python 3.9 or later.

Get access

Every account starts with 200 free credits, and sign-in is by email. The quickest way is to give your coding agent (Claude Code, Cursor or similar) this line:

set up https://mcp.datawebot.com/setup.md

The agent asks for your email and you approve the sign-in from the email datawebot sends. The key is saved to ~/.datawebot/credentials, readable only by you, and the script reads it from there. On a server or in CI, put the key in an environment variable named DATAWEBOT_API_KEY from your secret store instead, and never commit it.

The script

"""Search Walmart for a keyword, read each organic result's product page
and save the fields to a CSV file. Standard library only."""
import csv, json, os, sys, time, urllib.request

API = "https://api.datawebot.com/v1/requests"


def api_key():
    key = os.environ.get("DATAWEBOT_API_KEY")
    if key:
        return key
    # Written by the agent setup (https://mcp.datawebot.com/setup.md).
    with open(os.path.expanduser("~/.datawebot/credentials")) as f:
        return json.load(f)["profiles"]["https://mcp.datawebot.com"]["api_key"]


def call(method, url, body=None):
    req = urllib.request.Request(url, method=method,
        data=json.dumps(body).encode() if body else None,
        headers={"Authorization": "Bearer " + api_key(),
                 "Content-Type": "application/json",
                 "User-Agent": "walmart-products-example/1.0"})
    with urllib.request.urlopen(req, timeout=120) as r:
        return json.loads(r.read())


def ask(body):
    """Send a request; when the answer is "working", poll until it is done."""
    res = call("POST", API, body)
    for _ in range(40):
        if res.get("status") != "working":
            return res
        time.sleep(res.get("check_after_seconds") or 4)
        res = call("GET", f"{API}/{res['request_id']}")
    raise RuntimeError("still working after three minutes; try again later")


def ident(p, kind):
    """A product identifier by type: walmart_item_id, gtin or mpn."""
    ids = (p.get("details") or {}).get("identifiers") or []
    return next((i["value"] for i in ids if i["type"] == kind), "")


def amount(price):
    return (price or {}).get("amount")


def main(query, limit=5):
    found = ask({"capability": "search", "query": query,
                 "site": "walmart.com", "country": "US", "limit": limit})
    rows = []
    for hit in found["products"]:  # ads come back separately, in found["sponsored"]
        p = ask({"capability": "product", "product_id": hit["product_id"]})["product"]
        d = p.get("details") or {}
        seller = d.get("seller") or {}
        rows.append({
            "item_id": ident(p, "walmart_item_id"),
            "gtin": ident(p, "gtin"),
            "brand": d.get("brand"),
            "title": p["title"],
            "price": amount(p.get("price")),
            "original_price": amount(p.get("original_price")),
            "rating": p.get("rating"),
            "review_count": p.get("review_count"),
            "availability": p.get("availability"),
            "seller": seller.get("name"),
            "image_url": p.get("image_url"),
            "url": p["url"],
            "as_of": found["meta"]["as_of"],
        })
    with open("walmart_products.csv", "w", newline="", encoding="utf-8") as f:
        w = csv.DictWriter(f, fieldnames=list(rows[0]))
        w.writeheader()
        w.writerows(rows)
    print(f"{len(rows)} products saved to walmart_products.csv")
    for r in rows:
        print(f"{r['item_id']}  ${r['price']}  {r['rating']} ({r['review_count']})  {r['seller']}  {r['title'][:40]}")


if __name__ == "__main__":
    main(" ".join(sys.argv[1:]) or "chefman air fryer")

Run it with a keyword:

python3 walmart_products.py chefman air fryer

What it printed

This is the real output of the run on 16 November 2026 at 06:34 UTC. One search and five product reads cost 10 credits and took about two minutes in all.

5 products saved to walmart_products.csv
19937812797  $37.99  4.6 (510)  Chefman Direct  Chefman TurboFry 3-in-1 Air Fryer, 450°F
18683622604  $67.68  4.6 (724)  Chefman Direct  Chefman TurboFry Air Fryer, 450°F Max Te
14678059894  $64.97  4.6 (13936)  Walmart.com  Chefman Air Fryer 1500W, 6 Quart, 4 Func
17284765594  $34.99  4.5 (4053)  Chefman Direct  Chefman TurboFry 2-Quart Digital Air Fry
5231527365  $79.93  4.3 (3428)  Chefman Direct  Chefman Dual Basket Digital Air Fryer w/

The CSV has the Walmart item ID, GTIN, brand, title, price, original price, rating, review count, availability, seller, main image, product URL and the time of the search for every row. Four of the five listings are sold by Chefman Direct, a marketplace seller on Walmart, and one by Walmart itself. If you compare prices, keep the seller column: the same brand's products can be sold on Walmart by Walmart and by marketplace sellers, at different prices.

The search also returned one sponsored listing, which the script leaves out because it only reads found["products"].

How do you get Walmart data from an AI agent?

If you work in Claude, ChatGPT, Cursor or another agent that supports MCP, you do not need the script. After the setup line above, ask in plain language:

Use datawebot to search walmart.com for "chefman air fryer" and list the
organic results with price, original price, rating, seller and link.

The agent calls search_products with site set to walmart.com, then get_product for any listing you want in full. When you want a specific Walmart search URL, for example the second page of a search, it can run the Walmart search endpoint as a Job with find_endpoints and submit_job. The answers are the same JSON as the REST API, so you can move from trying things in an agent to a scheduled script without changing what you get. The MCP server page lists every tool and how to connect each client.

What should you check in Walmart data?

The runs above show four things to watch for, whichever Walmart scraper you use:

  1. Ads come back in their own list. The "air fryer" search returned 10 organic products and 5 sponsored ones, separately. If you merge the two lists, a paid placement can look like the top result.
  2. The seller changes the meaning of a price. Four of five Chefman listings were sold by Chefman Direct, a marketplace seller, and one by Walmart. A price comparison that ignores the seller mixes Walmart's own prices with third-party ones.
  3. Colours and sizes can sit on one page. The Chefman TurboFry 3-in-1 came back as one item ID with three variants: black, green and red. The variant records name the colour but carry no price of their own, so the record's price is for the page as it loaded; check the page if one colour's price matters.
  4. Every price is a snapshot. Each answer is what the page showed at meta.as_of. If you track prices, store that time with every row and read again on a schedule. The record does not take a store or ZIP code, so check the page itself if you need the price at one particular store.

How do you choose a Walmart scraper?

Use this checklist when you compare providers:

Question Why it matters
Are sponsored results separated from organic ones? A third of the first page in our search was ads
Does a product read return the seller and whether it is Walmart or a marketplace seller? Walmart's own prices and third-party prices answer different questions
Does it return the GTIN? It is the reliable way to match a Walmart listing to the same product in other stores
Is every answer labelled with the time it was read? Without it you cannot tell a stale price from a current one
Are failed requests free? You should not pay for a page that did not load
Can an AI agent call it, not only your code? MCP support lets you test questions in an agent before writing code
Does it say what it does not return? Stock levels, sales figures and stored price history are often implied but not provided

On the last point: datawebot reads what a public Walmart page shows. It does not return stock levels or sales figures for Walmart, and it does not keep price history for you. Your script and its CSV or database are the history. Our guide to building a price tracker with an AI agent shows one way to keep it.

What does it cost?

A Walmart search costs 5 credits a page and a product read 1 credit. Failed requests are free; a page that loads but has no results is still charged. Every account starts with 200 free credits, enough for the script above about 20 times with five products each. More credits are one-time packs with no subscription, listed on the pricing page. The Walmart endpoint page has an example request for each endpoint, and the same approach works for Amazon in our Amazon scraper guide and for Mercado Libre in our Mercado Libre scraper guide.

Need this at volume?

If you need more searches, more products or a regular run, send a volume request and we will size it in credits. Our published samples show the result format from other shops.

Frequently asked questions

What is a Walmart scraper?

A program or API that reads Walmart's public search and product pages and returns the fields as data: title, price, original price, rating, review count, seller, identifiers and link. With a scraper API you send a keyword or a product URL and get JSON back, without maintaining your own parser.

How do I scrape Walmart with Python?

Send a search request with site set to walmart.com, then read each result's product page and write the fields to a CSV. The script in this guide does that in about 80 lines of standard-library Python, for 10 credits per run of five products.

Does it return the GTIN or UPC?

Yes, when the product page shows it. The product read returns details.identifiers with the Walmart item ID, the GTIN and the manufacturer part number. In our read of the Gourmia air fryer, all three were present.

Does it return sponsored products?

Yes, separately. Sponsored listings come back in their own sponsored list, so the products list holds only organic results. In our "air fryer" search there were 10 organic and 5 sponsored.

Does it return the seller of a listing?

Yes. details.seller gives the seller's name and whether it is Walmart (official) or a marketplace seller (marketplace), with a link to the seller's page for marketplace sellers.

Which countries are supported?

walmart.com in the United States. Prices come back in US dollars.

Is there a free Walmart scraper API?

You can start free: every datawebot account gets 200 free credits with no card, enough for 40 searches or 200 product reads. After that, credits are one-time packs with no subscription.

Sources

  1. https://www.datawebot.com/llms.txt
  2. https://mcp.datawebot.com/setup.md
  3. https://www.datawebot.com/scraper/walmart
  4. https://www.datawebot.com/blog/walmart
  5. https://docs.python.org/3/library/csv.html
  6. https://docs.python.org/3/library/urllib.request.html
  7. https://docs.python.org/3/library/uuid.html
  8. https://modelcontextprotocol.io/specification/2025-06-18/server/tools

Give your agent ecommerce product data over MCP.

Every account starts with 200 free credits, with no subscription: a search costs 5 credits and a product read 1. Failed requests are free.

← All articles