The intensification of industrial and urban growth has precipitated a significant increase in atmospheric pollutant emissions, thereby exacerbating air quality deterioration. This phenomenon is particularly pronounced within the Beijing-Tianjin-Hebei urban agglomeration, where haze events have manifested with increasing frequency. Prior investigations have predominantly concentrated on temporal trends, often overlooking the critical impact of geographical factors on haze development. This research delves into the spatio-temporal distribution traits of haze within the Beijing-Tianjin-Hebei region, employing a Whale Optimization Algorithm-Long Short-Term Memory (WOA-LSTM) model. Findings indicate a pronounced spatial concentration of urban air pollution in the region's southern sector. In terms of temporal distribution, the Air Quality Index (AQI) demonstrates distinct seasonal fluctuations, with the highest pollution levels recorded in winter and notably lower levels observed during summer. The study's innovation lies in the development of a WOA-LSTM model, which not only predicts the AQI -a comprehensive haze pollution index -but also offers early warnings pertinent to public travel. By integrating extensive datasets and applying advanced analytical techniques, the study contributes significantly to understanding the complex interplay between urban dynamics and haze distribution. The research underscores the necessity for regional policies tailored to specific spatiotemporal characteristics, thereby aiding in effective air quality management and mitigation strategies within urban agglomerations.