Publix
Publix Categories API
The Publix product category tree: 16 departments (Bakery, Dairy, Deli, Meat, Produce, Liquor ...) with their categories and sub-categories, 382 nodes in all. Each node has id (the input of the category endpoint), name, url, parent_id, level and children. parent_id returns one department's or category's subtree. store_id is optional. Costs 1 credit per request.
POST/api/v1/publix/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/jsonstore_idstring | integerOptional. A Publix store number (stores[].store_id of the stores endpoint), 1-5 digits.
Example: 1614
parent_idstringReturn only this department's or category's subtree (categories[].id), a 36-character GUID.
Example: bcbd97a0-4588-411e-9f91-9245e6f350d0
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# Flatten the tree into (path, id) rows for the category endpoint.
tree = client.publix.categories()["data"]["categories"]
def walk(nodes, path=()):
for n in nodes:
yield " > ".join(path + (n["name"],)), n["id"]
yield from walk(n["children"], path + (n["name"],))
for path, cid in walk(tree):
print(path, cid)Response
"parent_id": null,
"store_id": null,
"count": 382,
},
"response_time": 4796
}