Urban air pollution is a critical global environmental issue, necessitating an understanding of the spatiotemporal characteristics and driving factors for effective environmental protection and urban planning. This study introduced an advanced air quality assessment system that integrates environmental, socio-economic, and urban layout factors, addressing gaps in traditional models that often overlook the impact of urban spatial structures. Analyzing air quality data from Beijing's main urban area (2016-2020) alongside multi-source geographic data, the research develops a comprehensive evaluation system, incorporating 14 key driving factors. Employing Geographically Weighted Regression (GWR) and Multi-scale Geographically Weighted Regression (MGWR), the study quantitatively assessed the influence and spatial heterogeneity of these factors. Findings revealed an annual improvement in air quality, with a U-shaped seasonal pattern and significant spatial clustering (Global Moran’s I = 0.922). The MGWR model, in particular, provided a superior fit over GWR, effectively capturing the spatial variability of factors. Variables such as NDVI), economic output (GDP), and humidity space adjustment capability (HSAC) showed significant positive spatial impacts on air quality, while population density (POP), temperature (TEMP), and road density (RD) exhibited negative effects. These insights enhance the understanding of air pollution dynamics and aid in refining urban planning strategies.