Air quality has become a concern in urban cities, particularly in areas where pollution levels pose significant health risks. Consequently, the objective of this study was to evaluate particulate matter (PM2.5, PM10) and gaseous pollutants (NO2, NH3, SO2, O3, and CO) and air quality indices at Lagos State, Nigeria using an internet of things (IoT)-based air quality assessment system designed to provide real-time data. Empirical results indicate that the predictive model achieved an accuracy of over 85% in forecasting air quality indices (AQI) and pollutant concentrations, with a mean absolute error (MAE) of 5.2 µg/m³ for PM2.5 and 4.8 µg/m³ for PM10. The model also demonstrated a high correlation coefficient (R² = 0.92) for PM2.5 and (R² = 0.89) for PM10, indicating strong predictive capabilities. The system recorded real-time data latency of less than 2 seconds, allowing for immediate insights into air quality conditions while peak recorded PM2.5 levels exceeded 150 µg/m³ on several occasions, correlating with increased hospital admissions for respiratory issues, which rose by 30% during high pollution days. This emphasizes that the ability to predict air quality in real-time can inform public health interventions and policy, guide urban planning decisions, and enhance community awareness regarding pollution levels.