International Energy Agency predicts that the global number of installed heat pumps (HP) will increase from 180 million in 2020 to approximately 600 million by 2030, covering 20% of buildings heating needs. Electric power consumption is one of the main key performance indicators for the heat pump systems from techno-economic perspective. However a common issue prevalent in many existing heat pumps is the lack of electric power measurement. The modern installations might be equipped with electric power measurement sensors but this comes at a higher system cost for the manufacturers and end-users. The primary objective of this work is to propose a virtual measurement for estimating power consumption, thereby eliminating the need for field measurement of power for heat pumps. To achieve the objective, a data-driven approach is proposed. Firstly, the in-situ data is preprocessed through data merging, cleaning, and normalization. Then, input features are pre-selected using Spearman correlation coefficients, and further refined by addressing multicollinearity problem. Following this, Extreme Gradient Boosting (XGBoost) models and polynomial models are developed by considering different features as inputs. All models are finally validated against the in-situ data from multi-units of ground source heat pump (GSHP) and air source heat pump (ASHP) installations. The results showed that the electric power consumption of GSHP can be estimated with high accuracy (99% for R2, 10 W for MAE, and 1% for MAPE) through generic data-driven models using only four easy-to-measure input features. Taking three input features as inputs for ASHP generic model, the accuracy can be reached to 83% for R2, 125 W for MAE, and 9% for MAPE. The method presented in this paper can be applied to estimate power consumption of millions of heat pumps and consequently add a significant value as well as provide different types of services, such as cost-saving benefits for manufacturers and end-users, flexibility services for aggregators and electricity grids.