Abstract With the aim of enhancing the accuracy of current models for forecasting vegetable prices and improving market structures, this study focuses on the prices of bell peppers at the Nanhuanqiao Market in Suzhou. In this paper, we propose a hybrid Convolutional Neural Network (CNN) and Gated Recurrent Unit (GRU) model for vegetable price forecasting based on Principal Component Analysis (PCA) and Attention Mechanism (ATT). Initially, we utilized the Pearson correlation coefficient to filter out the factors impacting prices. Then, we applied PCA to reduce dimensionality, extracting key price features. Next, we captured local sequence patterns with CNN, while handling time-series features with GRU. Finally, these outputs were integrated via ATT to generate the final prediction. Our results indicate that the hybrid CNN-GRU model, enhanced by PCA and ATT, achieved a Root Mean Square Error (RMSE) as low as 0.16. This performance is 11.11%, 11.11%, and 15.79% better than that of the PCA-CNN, PCA-GRU, and CNN-GRU-ATT models, respectively. Furthermore, in order to prove the effectiveness of our proposed model, the proposed model is compared with the state-of-the-art models and classical machine learning algorithms under the same dataset, the results indicate that our proposed hybrid deep learning model based on PCA and ATT shows the best performance. Consequently, our model offers a valuable reference for vegetable price prediction.