The urbanization process in China has to deal with numerous unique challenges, such as rapid urbanization, significant regional disparities, high natural resource consumption, severe environmental pollution, and difficulties in unified governance, all of which exacerbate the vulnerability of China's urban ecosystems. In order to investigate the urban ecological resilience (UER) in China, this study integrates natural factors into the ecological resilience assessment framework to evaluate UER in China. Using social network analysis based on a modified gravity model, the network structure characteristics of UER in China was assessed and the formation mechanism of spatial association networks was further explored, aiming to identify ecological vulnerabilities and resilient areas. The results indicate: (1) UER shows distinct regional differentiation, with a spatial distribution pattern exhibiting a gradient of decreasing values from east to west. In particular, economically developed areas in the eastern coastal regions show significant "radiation effects" in spatial associations, playing a "central" role in improving the overall UER of the region. (2) The overall network of UER is complex, but the network density is relatively low. The inter-regional connections and collaborative efforts in enhancing UER need to be strengthened. (3) Economic development level, innovation capacity, industrial structure, and geographical distance disparities in energy consumption significantly influenced the formation of spatial connections in UER across the nation. This study demonstrates the importance of strengthening inter-regional coordination and cooperation to enhance UER, providing empirical insights for the achievement of global sustainable development goals.