Due to the presence of variability and nonlinear attributes in traffic flow, developing an effective and resilient model for predicting traffic flow poses a significant challenge. Precisely predicting traffic flow is not merely a feasible issue; it also poses significant difficulties to the researchers involved in this field. This study proposes a hybrid predictive model to forecast traffic flow. The proposed model effectively merges the strengths of the Sparrow Search Algorithm (SSA) and Multi-layer Extreme Learning Machine (ML-ELM) model, enhancing prediction accuracy. SSA optimization technique is applied to optimize the initial weights and bias parameters for ML-ELM model. ELM approach is a machine learning approach that employs a single hidden layer to address various tasks. However, in situations where more complex problems are encountered, ML-ELM extends this concept by incorporating multiple hidden layers to enhance its capabilities and address challenges more effectively. Finally, SSA technique is utilized to achieve the optimal tuning of hyperparameters in the context of ML-ELM model to improve the prediction accuracy. Compared to the other selected models, the proposed model outperforms them in terms of performance metrics, including Root Mean Square Errors (RMSE), Mean Absolute Errors (MAE), Mean Absolute Percentage Errors (MAPE) and Correlation Coefficients (r), indicating that it is appropriate for this prediction task.