Costco
Costco Categories API
The Costco department list as JSON, or the full subcategory tree under one department: category_id, name and the slug the Category endpoint takes. Omit category_id for the top level. Costs 1 credit per request.
POST/api/v1/costco/categories
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/jsoncategory_idstringNumeric Costco category id. Omit for the top-level departments; pass one for its full subcategory tree.
Example: 30001
countryenum<string>default:uscostco.com (us) or costco.ca (ca).
Example: ca
us— costco.com, United States.ca— costco.ca, Canada.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
departments = client.costco.categories()
for c in departments["data"]["categories"]:
print(c["category_id"], c["name"], c["slug"])
# The subcategory tree under Appliances
appliances = client.costco.categories(category_id="30001")Response
"parent_category_id": null,
"count": 28,
},
"response_time": 668
}