Air pollution threatens worldwide human health, ecosystems, and climate change. Transportation is a major contributor to air pollution. However, the link between transportation and air pollution is intricate and influenced by multiple elements. This study employs spatiotemporal causal convolutional networks to predict air pollutants by utilizing traffic and meteorological data as inputs. Using Seoul, South Korea as a case study, a dataset of 25 regional air monitoring stations is used for prediction. The results confirm that wind speed and direction significantly impact PM2.5 dispersion, while humidity positively correlates with PM2.5 concentrations and temperature shows an inverse relationship. Additionally, vehicular traffic and subway passenger numbers exhibit positive associations, attributed to automotive emissions, road dust resuspension, and heightened human activity near subway stations, respectively. The model can potentially be utilized in a real-time air pollution tracking system to facilitate prompt interventions and reduce the harmful effects of air contamination on public health.