In recent times, air quality prediction is turned out to be one of the important research topics among research communities to prevent lives from negative health impacts. Random fluctuations of PM2.5 level brought about by frequent variations in meteorological factors create difficulties air pollution management. Forecasting the quality of air using time series data serves as a defense mechanism against threatening hazards by providing immense support to take preventive measures. Besides, handling dynamic real time workloads, forecasted by the prediction model requires appropriate computing resources to distribute workloads based on demands. To achieve this goal, this paper proposes a new Air Quality Prediction‐enabled Resource Allocation scheme for cloud‐based software services, which offers dynamic adjustment of resources based on workload demands with high energy efficiency. The proposed system is a two phase system that executes both air quality prediction and resource allocation processes consecutively. A new weighted average ensemble classifier is designed by combining support vector machine (SVM), artificial neural network (ANN), and gradient boosting machine (GBM) techniques to measure PM2.5 level on time series information of Beijing PM2.5 dataset. The system then dynamically allocates appropriate computing resources using crossover particle swarm optimization (CPSO) algorithm based on the forecasted results of PM2.5 level. This system has the potential to contribute significantly to reducing energy consumption and improving air quality in cities worldwide. The experimental results conducted to determine the efficiency of the proposed system in terms of different metrics proves that it achieves greater performance with less error functions for PM2.5 level prediction as well as minimizes energy consumption for resource allocation when compared with existing methods.