It would be nice to be able to bring to light the price gouging that is taking place in Canada with regards to grocery stores.

  • liverpoolbutter@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    10 months ago

    Firefox will basically hand you want you need to interact with APIs, here is an example in Powershell of getting a milk price from Superstore for a specific store

    $milk = Invoke-RestMethod -Uri "https://api.pcexpress.ca/product-facade/v4/products/20658152_EA?lang=en&date=16092023&pickupType=STORE&storeId=1511&banner=superstore" `
    -UserAgent "Mozilla/5.0 Gecko/20100101 Firefox/117.0" `
    -Headers @{
      "Origin_Session_Header" = "B"
      "DNT" = "1"
      "Business-User-Agent" = "PCXWEB"
      "x-apikey" = "C1xujSegT5j3ap3yexJjqhOfELwGKYvz"
    }
    
    $milk.offers.price.value
    

    The real question is with that apikey. I didn’t see it change across browsers or anything. Is it hardcoded? Does it change regularly? Someone could probably find out if they did enough digging