Fetch Catalog Data

You can fetch the catalog data by sending a request to the Catalog using the following code:

The catalog_fetch_data method in the Groclake library retrieves catalog items from the catalog lake. It allows developers to query paginated catalog data based on specific filters such as groc_item_id, groc_category, and stock status.

Python

try:
catalog_fetch_data = catalog.fetch(catalog_object)
print("catalog_fetch_data----", catalog_fetch_data)
items = catalog_fetch_data.get('items')
for item in items:
    print(item.get('client_item_id'), "item.get('client_item_id')")

except Exception as e:
    print(f"Error fetching catalog data: {e}")

Example of Catalog Object

{
    "client_item_id": "99999900001",
    "groc_item_id": "",
    "groc_category": "",
    "is_in_stock": "",
    "page_size": "20",
    "page_number": "1"
}

Example App Code

Last updated