Accurate predictions are vital for various applications, such as weather, climate, energy supply, transportation, and agriculture. The estimates of air temperature have been considered a crucial parameter in climate impact, and its prediction is challenging due to random changes and the non-linear relationship with other meteorological parameters such as wind speed, humidity, pressure, and soil moisture. Traditionally, Numerical Weather Prediction models serve the purpose of weather predictions, but they have their constraints and limitations. In recent years, the use of artificial intelligence (AI) technology has grown leaps and bounds in understating data-driven Earth systems. The present study employed two machine learning algorithms, namely extreme gradient boosting (XGBoost) and k-nearest neighbour (KNN), to predict the half-hourly temperature over Shadnagar (Latitude: 17.0713° N, Longitude: 78.2059° E), a semi-urban location in India. We utilized half-hourly meteorological parameters for training and testing data from January 1, 2016, to December 31, 2019. After the successful training of both models, predictions were made by taking the previous 72 hours of meteorological parameters for the prediction of 72 hours of temperature. The XGBoost and KNN models were evaluated using mean square error (MAE) and root mean square error (RMSE). The results showed that both models had similar MSE and RMSE values of around 2 and 1.4, respectively. The correlation coefficients for both models were high, approximately 0.95. Overall, both models performed well in predicting temperature values, with the KNN model exhibiting better accuracy after 24 hours. The results of the study can be helpful for developing more accurate temperature prediction models for near-real-time forecasting. Further, we have developed a Synergetic Machine learning Algorithms for near Real-time forecasting of Temperature (SMART), a GUI based application for near-real time temperature forecasting and provided the multi-model mean temperature predictions.