Objectives To examine (1) how visual green space quantity and quality affect depression among older adults; (2) whether and how the links may be mediated by perceived stress, physical activity, neighbourhood social cohesion, and air pollution (PM2.5); and (3) whether there are differences in the mediation across visual green space quantity and quality. Method We used older adults samples (aged over 65) from the WHO Study on Global Ageing and Adult Health in Shanghai, China. Depression was quantified by two self-reported questions related to the diagnosis of depression and medications or other treatments for depression. Visual green space quantity and quality were calculated using street view images and machine learning methods (street view green space = SVG). Mediators included perceived stress, social cohesion, physical activity, and PM2.5. Multilevel logistic and linear regression models were applied to understand the mediating roles of the above mediators in the link between visual green space quantity and quality and depression in older adults. Results SVG quantity and quality were negatively related to depression. Significant partial mediators for SVG quality were social cohesion and perceived stress. For SVG quantity, there was no evidence that any of the above mediators mediated the association. Conclusion Our results indicated that visual green space quantity and quality may be related to depression in older adults through different mechanisms.