Cynomorium songaricum is an important endangered plant with significant medicinal and edible values. However, the lack of resources and quality variation have limited the comprehensive developments and sustainable utilization of C. songaricum. Here, we evaluated the chemical and genetic traits of C. songaricum from the highly suitable habitat regions simulated with species distribution models. The PCA and NJ tree analyses displayed intraspecific variation in C. songaricum, which could be divided into two ecotypes: ecotype I and ecotype II. Furthermore, the LC-MS/MS-based metabolomic was used to identify and analyze the metabolites of two ecotypes. The results indicated that a total of 589 compounds were detected, 236 of which were significantly different between the two ecotypes. Specifically, the relative content and the kind of flavonoids were more abundant in ecotype I, which were closely associated with the medicinal activities. In contrast, amino acids and organic acids were more enriched in ecotype II, which may provide better nutritional quality and unique flavor. In summary, our findings demonstrate the ecotype division and chemical diversity of C. songaricum in China from different geographical regions and provide a reference for the development of germplasm and directed plant breeding of endangered medicinal plants.