Snap beans and kidney beans are poor nitrogen fixers and need nitrogen (N) fertilizer. However, excessive application of N leads to groundwater contamination. The traditional way of measuring crop nitrogen status is destructive and time-consuming. The objective of this study was to develop a tool that accurately predict the real-time crop nitrogen status and the end-of season yield for optimizing fertilizer management.The field trial was conducted in 2022 and 2023. Eight nitrogen treatments were applied at 22 kg ha-1, 56 kg ha-1, 84 kg ha-1, 112 kg ha-1, 140 kg ha-1, 168 kg ha-1, 196 kg ha-1, 224 kg ha-1 to three kidney beans cultivars. Six nitrogen treatments were applied at 22 kg ha-1, 56 kg ha-1, 84 kg ha-1, 112 kg ha-1, 140 kg ha-1, 168 kg ha-1 to two snap beans cultivars. Hyperspectral images (400 nm to 2500 nm) were collected on a weekly basis. Top twenty bands along with genotype (cultivars), environmental factors (temperature, precipitation, growing Degree Days), management factors (nitrogen rate, days after planting, irrigation) were used to train different machine learning algorithms including linear regression, random forest, XG Boost, support vector machine and k-nearest neighbors for predicting the nitrogen status and the final yield.Our results indicated that top twenty bands along with GEM performed the best for predicting final yield (R2 as high as 0.82 and RMSE as low as 1.6). Our study demonstrated the potential capacity of hyperspectral imaging and machine learning models to estimate crop yield and nitrogen status.