Costco
Costco Warehouse Locator API
Costco warehouses near a US zip code or a latitude and longitude: address, phone, distance, store, pharmacy and tire center hours, departments, services, and gas station hours and prices. Costs 1 credit per request, 2 on costco.ca.
POST/api/v1/costco/warehouses
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/jsonzipstringUS zip code. Send zip, or latitude and longitude.
Example: 10025
latitudenumberLatitude, -90 to 90. Use with longitude outside the US.
Example: 40.7993
longitudenumberLongitude, -180 to 180.
Example: -73.9668
limitintegerdefault:10Nearest warehouses to return, 1-50.
Example: 5
countryenum<string>default:usCostco site. us and ca support every parameter; uk, au, mx, jp, kr and tw support keyword, sort and paging only.
Example: uk
us— costco.com, United States.ca— costco.ca, Canada.uk— United Kingdom.au— Australia.mx— Mexico.jp— Japan.kr— South Korea.tw— Taiwan.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
nearby = client.costco.warehouses(zip="10025", limit=5)
for w in nearby["data"]["warehouses"]:
gas = w["gas_station"]
print(w["warehouse_id"], w["name"], w["distance_miles"], gas and gas["prices"]["regular"])Response
"country": "us",
"count": 5,
},
"response_time": 2315
}