A rapid and real-time method was established based on the combination of rapid evaporative ionization mass spectrometry (REIMS) and two-dimensional liquid chromatography mass spectrometry (2DLC-MS) for identification of wild Astragali Radix (WAR) and cultivated AR (CAR). The samples were analyzed under ambient ionization without time-consuming sample preparation. The phenotypic data of WAR and CAR were used to develop a real-time recognition model. Subsequently, the compounds in these two species were comprehensively characterized based on 2DLC-MS, and 45 different compounds were screened out by multivariate statistical analysis. A semi-quantitative method for 45 different compounds was established based on ultrahigh-performance liquid chromatography/quadrupole-linear ion trap mass spectrometry (UHPLC-QTRAP-MS). The results showed that the relative content of most compounds in WAR was higher than in CAR. In summary, the method has demonstrated remarkable performance in distinguishing between WAR and CAR, providing a reference in the field of traditional Chinese medicine (TCM) analysis and identification.