Abstract The main goal of this study was to create a strong predictive model for forecasting olive oil prices. To do this, we applied four machine learning models in Python: Random Forest, Gradient Boosting, Decision Tree, and Support Vector Regression, using 164 monthly price observations along with factors like temperature, precipitation, consumer price index, IBEX35 stock market prices, EUR/USD exchange rate, and import/export quantities. The results showed that Random Forest and Gradient Boosting models performed the best. The Spearman correlation analysis revealed that the exchange rate had a strong negative correlation with prices, while the consumer price index and import quantity had moderate positive correlations. Random Forest highlighted the consumer price index as the most important factor in predicting olive oil prices. This study fills a gap in existing research and provides practical insights for companies in the olive oil industry to better monitor and forecast prices, helping with profitability, risk management, stock optimization, and investment decisions.