This study explores the effectiveness of time series forecasting models for predicting air quality using datasets from a Purple Air Dual Laser Air Quality Sensor and the Kaggle Online platform. These datasets contain reliable and real sensor records, ensuring the richness of information required for environmental protection. The research focuses on identifying suitable forecast models for environmental analysis, including popular algorithm structures such as neural network models and ensemble models. Moreover, the study introduces the Explainable artificial intellect method to provide explanations for models with excellent performance indicators, thereby enhancing their trust and transparency. The performance of the models was evaluated using metrics such as mean absolute error, root mean square error, and coefficient of determination (R-squared). Results indicate that the neural network and ensemble models are effective in forecasting air quality time series. The study contributes to the body of knowledge on time series forecasting models and provides insights for future research in air quality prediction.