Grassland is the important terrestrial ecosystem, aboveground biomass is an important indicator of the productivity of grassland ecosystem, monitoring grassland is very important to the assessment of the current status of grassland growth and the conservation and development of grassland resources to Lanzhou city. In this study, the reflectance was extracted and the 9 vegetation indexes was calculated from Landsat images that combined with field sampling data of the grassland aboveground biomass in Lanzhou city in July-August 2021 to construct the two machine models that Random Forest model (RF) and eExtreme Gradient Boosting model (XGBoost) and chose the best model to invert the grass aboveground biomass in Lanzhou City from 2000 to 2023 and analyze its spatial and temporal dynamics.The results of the study show that: (1) The reflectance of other bands except b5-NIR band and nine vegetation indices were significantly correlated with grassland aboveground biomass by Pearson correlation analysis, so the remaining 14 factors except b5-NIR band were selected as model input variables. ( 2) Compared with the XGBoost model (R 2 of 0.78, RMSE of 37.03), the RF (R 2 of 0.89, RMSE of 23.28) model has a higher accuracy and it was more suitable for the inversion of aboveground biomass of grassland in Lanzhou city. (3) In time, the average value of aboveground biomass of grassland in Lanzhou City from 2000 to 2023 showed an increasing trend as a whole; In space, the aboveground biomass of grassland decreased firstly from southeast to northwest and then increased in Lanzhou City. The area of high value zone of grassland aboveground biomass increased, and the low value zone kept transforming to the high value zone. This study can provide theoretical reference and technical support for the estimation of aboveground biomass of grassland and the protection of grassland ecosystem in Lanzhou City.