diff --git a/redfish-core/lib/fan.hpp b/redfish-core/lib/fan.hpp
index fb2ba20..0acb762 100644
--- a/redfish-core/lib/fan.hpp
+++ b/redfish-core/lib/fan.hpp
@@ -278,6 +278,63 @@
         });
 }
 
+inline void getFanAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                        const std::string& fanPath, const std::string& service)
+{
+    sdbusplus::asio::getAllProperties(
+        *crow::connections::systemBus, service, fanPath,
+        "xyz.openbmc_project.Inventory.Decorator.Asset",
+        [fanPath, asyncResp{asyncResp}](
+            const boost::system::error_code& ec,
+            const dbus::utility::DBusPropertiesMap& assetList) {
+        if (ec)
+        {
+            if (ec.value() != EBADR)
+            {
+                BMCWEB_LOG_ERROR << "DBUS response error for Properties"
+                                 << ec.value();
+                messages::internalError(asyncResp->res);
+            }
+            return;
+        }
+        const std::string* manufacturer = nullptr;
+        const std::string* model = nullptr;
+        const std::string* partNumber = nullptr;
+        const std::string* serialNumber = nullptr;
+        const std::string* sparePartNumber = nullptr;
+
+        const bool success = sdbusplus::unpackPropertiesNoThrow(
+            dbus_utils::UnpackErrorPrinter(), assetList, "Manufacturer",
+            manufacturer, "Model", model, "PartNumber", partNumber,
+            "SerialNumber", serialNumber, "SparePartNumber", sparePartNumber);
+        if (!success)
+        {
+            messages::internalError(asyncResp->res);
+            return;
+        }
+        if (manufacturer != nullptr)
+        {
+            asyncResp->res.jsonValue["Manufacturer"] = *manufacturer;
+        }
+        if (model != nullptr)
+        {
+            asyncResp->res.jsonValue["Model"] = *model;
+        }
+        if (partNumber != nullptr)
+        {
+            asyncResp->res.jsonValue["PartNumber"] = *partNumber;
+        }
+        if (serialNumber != nullptr)
+        {
+            asyncResp->res.jsonValue["SerialNumber"] = *serialNumber;
+        }
+        if (sparePartNumber != nullptr && !sparePartNumber->empty())
+        {
+            asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
+        }
+        });
+}
+
 inline void
     afterGetValidFanPath(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                          const std::string& chassisId, const std::string& fanId,
@@ -286,6 +343,7 @@
     addFanCommonProperties(asyncResp->res, chassisId, fanId);
     getFanState(asyncResp, fanPath, service);
     getFanHealth(asyncResp, fanPath, service);
+    getFanAsset(asyncResp, fanPath, service);
 }
 
 inline void doFanGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
