Costco
Costco 賣場查詢 API
美國郵遞區號或指定緯度與經度附近的好市多賣場:地址、電話、距離,賣場、藥局與輪胎中心的營業時間,部門、服務,以及加油站的營業時間與油價。每次請求 1 點,costco.ca 為 2 點。
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/jsonzipstring美國郵遞區號。請傳入 zip,或 latitude 與 longitude。
Example: 10025
latitudenumber緯度,-90 到 90。美國以外的地區請與 longitude 一起使用。
Example: 40.7993
longitudenumber經度,-180 到 180。
Example: -73.9668
limitintegerdefault:10要回傳的最近賣場數量,1-50。
Example: 5
countryenum<string>default:us好市多網站。us 與 ca 支援所有參數;uk、au、mx、jp、kr 與 tw 僅支援關鍵字、排序與分頁。
Example: uk
us— costco.com,美國。ca— costco.ca,加拿大。uk— 英國。au— 澳洲。mx— 墨西哥。jp— 日本。kr— 韓國。tw— 台灣。
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
}