Monitor Walmart prices for a set of products with Python

Build a Walmart search URL, walk the nested groups and items in the response, and pair it with the Amazon endpoint to compare a price across both. Tested August 2026.

Repricing and competitive monitoring both start with the same question: what is this product selling for on Walmart right now. This is how to pull that as structured fields with Python, what the response actually looks like once you get past the first level, and the one credit-saving move worth knowing if you also track the same product on Amazon.

The endpoint wants a URL, not a query string

/v1/walmart does not take a query parameter. It takes url, and that url has to be a real Walmart search URL, the kind you would type into the address bar. You build it yourself:

from urllib.parse import urlencode

def walmart_search_url(query):
    return "https://www.walmart.com/search?" + urlencode({"q": query})

That is the whole trick: Walmart’s own search page takes a q parameter, so any product name, brand, or UPC you would normally type into the search box works here too. Pass the finished URL as url and FastAF fetches and parses it. Because it is a real, ordinary URL rather than a made-up query format, any sort or filter you can set on Walmart’s own search page by hand carries through the same way, since the URL is what actually gets fetched.

The version that works

import requests

API_KEY = "faf_live_..."  # your FastAF key

resp = requests.get(
    "https://api.fastaf.co/v1/walmart",
    params={"url": walmart_search_url("web scraping api")},
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=60,
)
resp.raise_for_status()

for group in resp.json()["search_results"]:
    for item in group["item"]:
        print(f'{item["current_price"]:>10}  {item["seller_name"]:<20}  {item["usItemId"]}  {item["title"][:50]}')

That costs 5 credits and prints a row per product: current price, seller, the usItemId you use to track that exact listing, and the title.

Groups first, products inside the groups

search_results is not a flat list of products. It is a list of groups, each with its own title, description, totalItemCount, and an item list, and the products live inside item. Running the query above, the response came back as two groups: a “Results for …” group with zero items, and an “Other options to consider” group carrying 40 of its reported 54 items. Code that only reads the first group would print nothing and look broken. Loop every group, as the example above does, and you get all 40.

Prices arrive as display strings, not numbers: "$19.59" normally, "Now $18.61" when before_price holds the pre-discount value. A small helper handles both:

def clean_price(raw):
    if not raw:
        return None
    return float(raw.replace("Now $", "").replace("$", "").replace(",", ""))

Store usItemId as the stable key. current_price, seller_name, and availability_status are the three fields that actually change between checks; everything else on a listing (title, brand, canonicalUrl) is there for display and rarely worth diffing.

Two fields worth knowing before you rely on them: rating and reviews come back null on most search results in practice, so build your monitoring around price and stock, not review counts, unless you have confirmed a given listing carries them. seller_name is worth checking too: a Walmart search mixes listings sold directly by Walmart.com with ones sold by marketplace sellers, and the sample above turned up both plus a handful of third-party booksellers, each entry carrying its own seller_name and current_price. If your repricing rule is specifically about matching Walmart’s own price rather than every reseller that shows up in search, filter on seller_name before you diff anything.

Track it over time, then check it against Amazon

A repricing job is just this call on a schedule: save clean_price(item["current_price"]) per usItemId, compare to the last saved value, and alert past whatever threshold matters to you. Three checks a day per SKU is 15 credits a day, or about 450 credits a month per product tracked.

If you sell the same item in more than one place, the Amazon endpoint (1 credit, versus 5 here) answers the other half of the question:

def amazon_price(query):
    resp = requests.get(
        "https://api.fastaf.co/v1/amazon",
        params={"query": query, "domain": "com"},
        headers={"Authorization": f"Bearer {API_KEY}"},
        timeout=60,
    )
    resp.raise_for_status()
    for item in resp.json()["results"]:
        if item["type"] == "search_product":
            return item["extracted_price"]

Six credits gets you the same product’s price on both marketplaces in one pass, which is normally exactly what a repricing rule needs: not just “did our price move” but “are we still competitive against the other channel.” Run the pair on the same schedule and store both prices next to each other, so a gap between marketplaces shows up as a row in your own data instead of something you notice by accident weeks later.

What this costs

Volume Credits (30 days) Pack that covers it Cost
300 SKUs, checked once a day 45,000 Growth, $29 ~$17.40 of the pack
1,000 SKUs, checked twice a day 300,000 Scale, $99 the whole pack
5,000 SKUs, one-off sweep 25,000 Growth, $29 ~$9.67 of the pack

Failed requests are never billed, credits are reserved when a request starts and returned if nothing comes back. Start on the free tier: 500 credits, no card, enough to point this at your own catalog and see what the response looks like before you commit a schedule to it.