Walgreens
Walgreens Store Stock API
Live in-store stock of one Walgreens product at up to 20 stores in one call: per store the status (In Stock, Out of Stock, or Not Available when the store does not carry it), the unit count and in_stock, plus how many of the stores have it. Store numbers Walgreens does not recognise come back in unknown_store_ids. Costs 4 credits per request.
POST/api/v1/walgreens/stock
Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your Scavio API key (e.g. Bearer sk_live_your_key).
Body
application/jsonproduct_idstringrequiredWalgreens product id, the product_id of a search result ("300452904" or "prod6345045"), or a walgreens.com product URL.
Example: 300452904
store_idsstring[]required1-20 Walgreens store numbers, the store_number field of /api/v1/walgreens/stores.
Example: ["15350", "15992", "1173"]
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# Store numbers near ZIP 60614, then the product's units at each
stores = client.walgreens.stores(zip="60614", limit=5)["data"]["stores"]
ids = [s["store_number"] for s in stores]
res = client.walgreens.stock(product_id="300452904", store_ids=ids)["data"]
print(res["in_stock_count"], "of", res["count"], "stores have it")
for s in res["stores"]:
print(s["store_number"], s["status"], s["quantity"])Response
"product_id": "300452904",
"article_id": "000000000012456764",
"planogram": "40000735502",
"count": 5,
"in_stock_count": 5,
"unknown_store_ids": []
},
"response_time": 2263
}