JCPenney
JCPenney Store Availability API
Real unit counts for one JCPenney SKU at the 5 nearest stores to a ZIP code (or lat + lng): quantity, status (in_stock, low, out_of_stock, not_stocked), when the count was refreshed, and each store's address, phone, distance and hours. Also returns how many of the 5 have it and the total units. in_stock_only drops the stores that have none. Take the SKU from the product endpoint's variants. Costs 1 credit per request.
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/jsonskustringrequiredA JCPenney SKU id: a product's variants[].sku (or a search result's sku_id / colors[].sku_id).
Example: 84630160042
zipstringUS or Puerto Rico ZIP code: the 5 nearest stores are checked. One of zip or lat + lng is required.
Example: 90012
latnumberLatitude (with lng), instead of zip.
Example: 33.03
lngnumberLongitude (with lat).
Example: -96.82
radiusintegerSearch radius in miles, 1-100. Defaults to 25.
Example: 50
in_stock_onlybooleanDrop the stores (of the 5 nearest) that have none.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# 1. The product's variants carry the sku of each color and size.
p = client.jcpenney.product(product_id="ppr5008604049")["data"]
sku = next(v["sku"] for v in p["variants"] if v["color"] == "Rinse" and v["size"] == "6")
# 2. Unit counts at the 5 nearest stores to a ZIP.
res = client.jcpenney.store_availability(sku=sku, zip="90012")["data"]
print(res["stores_with_stock"], "of", res["count"], "stores,", res["total_quantity"], "units")
for s in res["stores"]:
print(s["name"], s["distance_miles"], s["quantity"], s["status"])Response