Maintaining the optimum viscosity of foam required to create the effective fracture permeability and placing the proppant inside the fracture are difficult because of its poor thermal stability. The objective of this study is to optimize the viscosity of foam by using the Response Surface Methodology (RSM) technique. The Box-Behnken design matrix was selected based on the feasibility, efficiency and simplicity of response surface methodology, which contains 17 number of experiments. Statistical analysis of the model was performed by Analysis of variance (ANOVA), which helps to confirm the robustness of the tested model. The diagnosis of the model was reported with internally studentized residual plots, which proves that the data is authentic with less error value, and the model is significant. The desirability function approach is utilized to analyze the optimized viscosity, followed with a confirmation test, which assists in validating the predicted optimal viscosity results. The input parameters, such as solid particles concentration and foam quality, were set in a range and temperature was set to be at maximizing condition, so that corresponding response, i.e., viscosity was optimized. The optimized viscosity of the foam fracturing fluids systems is in between 36.74 and 74.61 cP at 500 s−1 shear rate. The abovementioned methods and its analysis for the estimation of the optimal viscosity at a high shear rate are very significant and consequently acceptable for the design and development of foam fracturing fluid at the field conditions of unconventional reservoirs. This method is expected to apply for effective designing of foam for fracking of unconventional reservoirs without undergoing rigorous field trials for selecting the correct foam composition. • Optimized viscosity of stabilized foam fracturing fluid at operating shear rate using RSM. • RSM is an essential part of Design of Experiment (DOE). • Applied Analysis of Variance for the testing the significance of the model. • Used Desirability function for the optimization analysis in the RSM. • Model is accurate for predictions of optimal viscosity. [ABSTRACT FROM AUTHOR]