Uncategorized

Systembolaget saldon

Posted
import requests
import json


pId = [["Fresh & Hazy",14224368], ["Dark & Creamy",14224350],["Smooth & Spicy",14224330],["Delicate & Noble - German Ale",21832723],["Light & Delicious",14224073]]
mylist = []
 
for pa1 in pId:
  url='https://www.systembolaget.se/api/product/getstockbalance'
  payload = {"productId": pa1[1] ,"siteIds":["1428"]}
  headers = {"content-type": "application/json; charset=UTF-8"}
  resp = requests.post(url, headers=headers, data=json.dumps(payload))
  data = resp.json()
  stockstore = (data[0]['StockTextShort'])
  print(pa1[0], stockstore)
  mylist.append(pa1[0])  
  mylist.append(stockstore)