Soil contamination of heavy metals in urban greenspaces can exert detrimental impacts on ecological biodiversity and the health of inhabitants through cross-media migration-induced risks. Here, a total of 72 topsoil samples were collected from greenspaces in the popular tourist city of Tianshui, ranging from areas with parks, residential, road, industrial and educational soils. The study aimed to evaluate an integrated source-specific ecological and human health risk assessment of heavy metals. Among the analyzed heavy metals, except Cr (mean), all exceeded the local background values by 1.30-5.67-fold, and Hg, Cd, Pb and As were the metals with large CV values. The Igeo and CF results showed Hg, Cd, As and Pb exhibited significantly high pollution levels and were the primary pollution factors. The mean PLI values indicated moderate pollution in educational (2.21), industrial (2.07), and road (2.02) soils but slight pollution in park (1.84) and residential (1.39) greenspaces. The Igeo, CF, and PLI results also revealing that these heavy metals are more likely to be affected by human activity. Four primary source factors were identified based on PMF model: coal combustion (25.57%), agricultural sources (14.49%), atmospheric deposition (20.44%) and mixed sources (39.50%). In terms of ecological risk, the mean IRI values showed considerable risks in educational soils (287.52) and moderate risks in road (215.09), park (151.27) and residential (136.71) soils. And the contribution ratio of atmospheric deposition for park, residential, road, industrial and educational greenspaces were 57.72%, 65.41%, 67.69%, 59.60% and 75.76%, respectively. In terms of human health risk, the HI (below 1) and CR (below 1.00E-04) for adults from soils of all land use types was negligible. However, children have more significant non-carcinogenic and carcinogenic hazards especially in residential soils, the HI (above 1) and CR (above 1.00E-04) revealed the significance of regarding legacy As contamination from coal combustion when formulating risk mitigation strategies in this area. The proposed method for source and risk identification makes the multifaceted concerns of pollution and the different relevant risks into a concrete decision-making process, providing robust support for soil contamination control.