Gut microbiota plays a crucial role in human health and can be influenced by environmental factors. While past studies have examined the impact of the environment on gut microbiota, vulnerable populations have often been overlooked. This study aimed to investigate the association between environmental exposures, air pollution and greenspace, and gut microbiota in asthmatic children. Data were collected during the recovery period for 41 eligible children. Air pollution was estimated using an ensemble learning model that combined regression and machine-learning algorithms, while greenspace was quantified using the normalized difference vegetation index (NDVI) and green land-cover data. The lag effects of exposures were assessed within defined buffer zones surrounding each child's residence. A generalized additive model was applied to examine associations. Results revealed a marginally significant negative association between 1-day lag exposure to NO₂ and gut microbiota indices, such as observed bacteria (Coef.: -1.130
95 %CI -2.287, 0.027) and bacterial richness (Coef.: -2.420
95 %CI -4.987, 0.146). The 8-day lagged average exposure to PM