Found this while investigating a similar question, and stumbled upon an answer. I am trying to build a tool that allows me to auto-categorize some purchases. Unfortunately, Walmart takes their security quite seriously and has implemented several measures to prevent running automated tools on their website (even with things like puppeteer-stealth
)
However, today I found out that if you go to https://walmart.com/receipt-lookup, and check out the network tab—you can actually see a request goes out to https://walmart.com/chcwebapp/api/receipts and it only requires a few parameters:
{
"storeId": number;
"purchaseDate": string - MM-DD-YYYY;
"cardType": string (ex. "visa")
"total": number (ex. 100.89)
"lastFourDigits": string (ex. "1234")
}
For completeness, an example cURL request:
curl 'https://www.walmart.com/chcwebapp/api/receipts' \
-H 'sec-ch-ua: "Chromium";v="98", " Not A;Brand";v="99", "Google Chrome";v="98"' \
-H 'accept: application/json' \
-H 'Referer: https://www.walmart.com/receipt-lookup' \
-H 'content-type: application/json' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' \
-H 'sec-ch-ua-platform: "Mac OS X"' \
--data-raw '{"storeId":"123","purchaseDate":"02-19-2022","cardType":"visa","total":"100.00","lastFourDigits":"1234"}' \
--compressed
It doesn't appear to require any type of authentication as a quick glance at the request shows no cookies!
I am ecstatic to have found this. I'm not totally sure if it will fit your needs, but since my tool already has access to the total, last 4, and date all I need is the storeId which I can easily hard-code since we only shop at one Walmart!
As an aside, if anyone from Walmart's engineering team ever sees this—please consider allowing the develop community access to their own data. I totally get implementing PerimeterX Bot Defense for things like PS5 releases, but blocking login attempts just to look at my own receipts? It seems like taking out an anthill with a bazooka.