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
catalog_object = {
"groc_item_id": "",
"groc_category": "",
"is_in_stock": "",
"page_size": "20",
"page_number": "1"
}
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')")
#RESPONSE FOR CATALOG FETCH
# {
# "api_action_status": "success",
# "catalog_fetch_request_id": "cf579745-3b83-45d4-b5aa-6b3a3eb2f194",
# "groc_account_id": "c4ca4238a0b923820dcc509a6f75849b",
# "items": [
# {
# "client_item_id": "0018",
# "groc_catalog_id": "c4ca4238a0b923820dcc509a6f75849b",
# "groc_item_id": 2296143503,
# "groc_category": "DRESS",
# "groc_category_id": "1",
# "product_type": "simple",
# "name": "blue dress",
# "description": "new patter dress",
# "short_description": "new patter dress",
# "category": "Dress",
# "variant_group_id": "11111",
# "variant": "Size",
# "location_id": [
# ""
# ],
# "inventory_info": {
# "qty": "1.0",
# "min_qty": "10.0",
# "max_qty": "1.0",
# "is_in_stock": "1"
# },
# "pricing_info": {
# "mrp": "599.0",
# "sale_price": "299.0",
# "discount_start_date": "None",
# "discount_end_date": "None",
# "discounted_price": "0.0"
# },
# "images": [
# "https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg",
# "https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg",
# "https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg",
# "https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg"
# ],
# "attributes": {
# "pattern": "",
# "material": "",
# "occasion": "",
# "season": "",
# "trend": "",
# "features": "",
# "material_finish": "",
# "size_chart": "",
# "fulfillment_mode": "",
# "available_on_cod": 0,
# "cancellable": 0,
# "rateable": 0,
# "return_pickup": 0,
# "return_window": null,
# "returnable": 0,
# "time_to_ship": null,
# "common_or_generic_name_of_commodity": "",
# "imported_product_country_of_origin": "",
# "manufacturer_address": "",
# "manufacturer_name": "",
# "measure_of_commodity_in_pkg": "",
# "month_year_of_manufacture": null,
# "nutritional_info": "",
# "additives_info": "",
# "brand_owner_fssai_license_no": "",
# "other_fssai_license_no": "",
# "importer_fssai_license_no": "",
# "is_veg": 0,
# "ondc_domain": "",
# "gender": "",
# "colour": "",
# "size": "",
# "brand": "",
# "fabric": "",
# "strap_material": "",
# "water_resistant": "0",
# "display": "",
# "glass_material": "",
# "colour_name": "",
# "sport_type": "",
# "base_metal": "",
# "plating": "",
# "care_instructions": "",
# "wash_type": "",
# "fit": "",
# "collar": "",
# "neck": "",
# "hemline": "",
# "sleeve_length": "",
# "battery_life": "",
# "bluetooth": "",
# "model": "",
# "model_year": null,
# "os_type": "",
# "weight": "0",
# "length": "0",
# "breadth": "0",
# "height": "0",
# "refurbished": 0,
# "skin_type": "",
# "ingredient": "",
# "formulation": "",
# "veg_nonveg_flag": 0,
# "upc_code": null,
# "ram": null,
# "ram_unit": null,
# "storage": null,
# "storage_unit": null,
# "storage_type": null,
# "screen_size": null,
# "cpu": null,
# "os_version": null,
# "form_factor": null,
# "expiry_date": null,
# "best_before": null,
# "marketed_by": null,
# "net_weight": "0",
# "number_of_items": "0",
# "item_quantity": "0",
# "flavour": null,
# "country_of_origin": null,
# "number_of_pieces": "0",
# "allergen_information": null,
# "package_information": null,
# "package_weight": "0",
# "item_form": null,
# "sodium_mg": "0",
# "total_fat_gm": "0",
# "total_fat_saturated_gm": "0",
# "total_fat_trans_gm": "0",
# "energy_kcal": "0",
# "protein_gm": "0",
# "carbohydrates_gm": "0",
# "scent": null,
# "consumer_care_phone": null,
# "consumer_care_email": null,
# "manufacturing_date": null,
# "batch_number": null,
# "product_description": null,
# "product_benefits": null,
# "product_highlights": null,
# "item_volume": "0",
# "net_volume": "0",
# "product_disclaimer": null,
# "product_instructions": null,
# "more_image_links": "",
# "scan_type": null,
# "GTIN": null,
# "CSIN": null,
# "fssai_number": null,
# "marketing_fssai_number": null,
# "manufacturer_fssai_number": null,
# "request_id": 0,
# "created_at": "2024-11-12 11:06:38",
# "updated_at": "2024-11-12 11:06:38",
# "cache_enabled": 1,
# "cdn_image1": "https://cdnaz.plotch.io/image/upload/C/V/PLOkfbsY411731389794_3852baab04d0ecc9d23491de295c8293c78b9b0c7213aa4023bda83fc63b93f8.png",
# "cdn_image2": "https://cdnaz.plotch.io/image/upload/C/V/PLOzP8JVUd1731389795_3852baab04d0ecc9d23491de295c8293c78b9b0c7213aa4023bda83fc63b93f8.png",
# "cdn_image3": "https://cdnaz.plotch.io/image/upload/C/V/PLOKvnmHat1731389796_3852baab04d0ecc9d23491de295c8293c78b9b0c7213aa4023bda83fc63b93f8.png",
# "cdn_image4": "https://cdnaz.plotch.io/image/upload/C/V/PLOF742NCQ1731389797_3852baab04d0ecc9d23491de295c8293c78b9b0c7213aa4023bda83fc63b93f8.png",
# "cataloglake_id": null,
# "provider_id": null
# }
# }
# ]
# }
Last updated