DEV Community

Omar Eldeeb
Omar Eldeeb

Posted on Originally published at datatooly.xyz

Walmart and Target Price Scraper: Search and Product Pages

A Walmart or Target price scraper reads the price, was-price, stock and GTIN from product pages, or from every product on a search or category page. Both retailers work without a browser. Match the same item across the two by GTIN, not by name: Walmart printed UPCs with 12 digits and Target with 13 (a leading zero) in our runs, so strip leading zeros first.

This guide uses an Apify actor that supports both retailers and shows real output from 2026-10-20, a Python script that matches the same products on both stores, and the caveats that matter for price data.

What works on each retailer

From the E-commerce Product Scraper Pro supported-sites table (both listed as supported):

Walmart (walmart.com) Target (target.com)
Product pages yes yes
Category and search pages yes, with pagination yes, with pagination
Keyword search yes yes
Reviews all pages all pages
Sellers marketplace seller profiles store contact only
How pages are reached Datacenter Datacenter, with a crawler user agent

Walmart Mexico (walmart.com.mx) is supported too, with prices in MXN: product pages, category and search pages and keyword search over datacenter connections, and reviews best-effort (from the page's data). walmart.ca and Bodega Aurrera (bodegaaurrera.com.mx) are best-effort. In the actor's AUTO mode, each page starts on the cheapest route that works for the site and moves to a residential proxy or a browser only when it's blocked. For Target that first route is a crawler-style request. In our October test runs, all 70 Target product rows came that way. Walmart rows came over datacenter connections 288 times out of 340 and over residential 52 times. A residential page adds a traffic fee, billed only for items that delivered.

Don't switch the scrape mode to BROWSER for these two. In the actor's cloud tests, Walmart answered the browser with a PerimeterX challenge, and Target rendered its pages without a price.

A search page from each store

This input reads the first ten results of a "lego" search on each store, with monitor mode on so the next run flags price changes:

{
  "listingUrls": [
    { "url": "https://www.target.com/s?searchTerm=lego" },
    { "url": "https://www.walmart.com/search?q=lego" }
  ],
  "maxItemsPerStartUrl": 10,
  "maxProductResults": 20,
  "monitorMode": true
}
Enter fullscreen mode Exit fullscreen mode

All five rows from a smaller run of the same input on 2026-10-20 (maxItemsPerStartUrl: 3, maxProductResults: 5; run F0TqL6QA5Rd6wTf9w), names shortened:

Store position sponsored Product price originalPrice gtin
Target 1 null LEGO Minifigures Shrek Series Mystery Box 71053 4.99 null 0673419424301
Target 2 null LEGO Marvel Spider-Man vs. Anti-Venom Heist 30725 4.99 null 0673419421164
Target 3 null LEGO Speed Champions The Fast and The Furious Toyota Supra MK4 77260 27.99 29.99 0673419424769
Walmart 1 false LEGO Harry Potter Hogwarts Castle and Grounds 76419 136.99 169.99 673419375863
Walmart 2 false LEGO Creator 3 in 1 Cute Hamster with a Flower - 31376 9.97 20.39 673419419291

position is the product's rank on that search input. On Walmart it's the organic rank, 1 to n in the order Walmart lists the results. Walmart's ads are kept but flagged: sponsored: true, a separate adPosition, and position: null. They never take one of the organic slots your maxItemsPerStartUrl cap allows, and color or size swatches of the same item don't come back as separate products. On Target, sponsored is null because the actor can't tell Target's ads apart; treat it as unknown. To keep only organic results, drop the rows where sponsored is true.

originalPrice is the was-price the page shows, and it appears only when it's higher than price. Walmart's hamster set shows $20.39 against $9.97. A was-price is a retailer's claim, not proof of a discount, and stores don't agree on them: the GTIN script below finds the LEGO Daisies set at $9.89 on both stores, with a was-price only on Walmart. See spotting fake Black Friday discounts.

You can also skip the URLs and search by keyword: "keyword": "usb c cable" with "marketplaces": ["www.walmart.com", "www.target.com"] runs the same search on both stores, and each row carries the keyword. For Walmart Mexico, add "www.walmart.com.mx". A Walmart search with no results returns a status row with outcome: "not-found" ("Walmart's search lists no results for this keyword") and isn't billed beyond the run's start fee.

Python: match the same products on Walmart and Target

import os
from collections import defaultdict
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("constructive_calm/ecommerce-product-scraper-pro").call(run_input={
    "detailsUrls": [
        {"url": "https://www.walmart.com/ip/LEGO-Botanicals-11508/17091312501"},
        {"url": "https://www.target.com/p/lego-botanicals-daisies-building-toy-for-kids-11508/-/A-94756752"},
        {"url": "https://www.walmart.com/ip/LEGO-Minifigures-71053/18839271940"},
        {"url": "https://www.target.com/p/lego-minifigures-shrek-series-mystery-box-71053/-/A-95046345"},
    ],
    "maxProductResults": 4,
})

def gtin_key(g):
    """Walmart prints UPCs as 12 digits, Target as 13 with a leading 0: compare without leading zeros."""
    return g.lstrip("0") if g else None

by_gtin = defaultdict(dict)
for p in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{p['site']:<11} gtin={p['gtin']:<14} {p['price']:>6} {p['currency']} was={p['originalPrice']} "
          f"inStock={p['inStock']} seller={p['seller']} via={p['tierUsed']}  {p['name'][:40]}")
    if gtin_key(p["gtin"]):
        by_gtin[gtin_key(p["gtin"])][p["site"]] = p["price"]

for gtin, prices in by_gtin.items():
    if len(prices) > 1:
        low = min(prices.values())
        winners = [site for site, price in prices.items() if price == low]
        print(f"GTIN {gtin}: {prices} -> lowest: {' = '.join(winners)}")
Enter fullscreen mode Exit fullscreen mode

Output on 2026-10-20 (pip install apify-client, APIFY_TOKEN set to your Apify API token):

target      gtin=0673419424301    4.99 USD was=None inStock=True seller=None via=crawler-ua  LEGO Minifigures Shrek Series Mystery Bo
target      gtin=0673419422000    9.89 USD was=None inStock=True seller=None via=crawler-ua  LEGO Botanicals Daisies Building Toy for
walmart-us  gtin=673419422000     9.89 USD was=14.99 inStock=True seller=Walmart.com via=datacenter  LEGO Botanicals Daisies Building Toy - B
walmart-us  gtin=673419424301     4.97 USD was=None inStock=True seller=Walmart.com via=datacenter  LEGO Minifigures Shrek Series 1-Pack - M
GTIN 673419424301: {'target': 4.99, 'walmart-us': 4.97} -> lowest: walmart-us
GTIN 673419422000: {'target': 9.89, 'walmart-us': 9.89} -> lowest: target = walmart-us
Enter fullscreen mode Exit fullscreen mode

To match whole search pages instead of hand-picked URLs, run the listing input above and feed its rows to the same gtin_key grouping. Products that only one store carries simply won't pair.

Fields that differ between the two

Field Walmart Target
sku Walmart item id (17091312501) Target's TCIN (94756752)
gtin 12-digit UPC 13 digits, leading zero
seller "Walmart.com" or the marketplace seller's name null in our runs
additionalProperties specifications, highlights, sellerId, fulfillmentType site extras when present
unitPrice when the page shows one, e.g. 0.027 per fl oz on a gallon of milk when the page shows one
variants[] pack sizes, colors and lengths with their own prices colors and sizes, on products that have them

On Walmart, check seller before you compare prices. A third-party marketplace offer can be the one shown, and its price, shipping and returns aren't Walmart's. Seller profiles go in the sellerUrls input and return the seller's name, address, rating and published contact details.

Caveats for price data

  • Store and ZIP prices. The actor has no store or ZIP code input. Rows contain the price each page serves to a visitor who hasn't chosen a store. Don't treat it as the shelf price in a particular store.
  • Out-of-stock items. In our test runs, some out-of-stock Walmart products came back with inStock: false and no price. Store null as "unknown", not zero.
  • Was-prices differ by store. As the Daisies example shows, one store may show a was-price and the other not, for the same product at the same price.
  • Listings move. position reflects the search at that moment, and the order can change from run to run. On Walmart, ads are flagged (sponsored: true) and kept out of position; on Target they aren't identified.

What it costs

Pay per event, from the actor's pricing table. Both stores are usually reached without residential traffic, so the main events are:

Event FREE GOLD
Actor start (per run, 1 GB) $0.005 $0.005
Product scraped $0.0048 $0.0008
Listing page scraped $0.0004 $0.00021

The README's example, a 20-page category with 1,000 products: 20 × $0.00021 + 1,000 × $0.0008 + $0.005 = $0.809 on GOLD. On FREE: 20 × $0.0004 + 1,000 × $0.0048 + $0.005 = $4.813. Pages that escalate to residential add $0.018 (FREE) to $0.014 (GOLD) per MB for items that delivered. Apify's free plan includes $5 of usage every month, with no credit card required. There's no free trial inside the actor.

Holiday season: one GTIN list, both stores, every day

Black Friday is Friday, November 27, 2026, and Cyber Monday is November 30. If you buy or sell toys, electronics or anything both retailers stock, build one input with the Walmart and Target URLs of the same GTINs and schedule it daily from early November with monitorMode: true. Each run then shows which store moved first and by how much (previousPrice, priceChange), and the GTIN script above shows which store is lower that day. To compare more stores than these two, see comparing Black Friday prices across stores. For dates and lead times, see the holiday sales calendar.

Related guides

Do it without code

The free e-commerce price tracker builder has a "Walmart only", "Target only" and "US: Amazon + Walmart + Target" keyword option. It produces a ready-to-run input for the actor and shows a fixed example of the output, not live prices.

Disclosure: I built the actor and this site.

Sources: actor runs on 2026-10-20 (search table: run F0TqL6QA5Rd6wTf9w, build 0.1.16; GTIN script; milk unit price), our October 2026 cloud test runs (tier counts, out-of-stock rows, and a zero-result Walmart search on build 0.1.16), and the actor's README (supported-sites table, browser-mode note, pricing).

Top comments (0)