Potable water scarcity is a worldwide issue that can be addressed by looking for new regions with adequate groundwater. The study used a combination of three metaheuristic optimization algorithms (particle swarm optimization (PSO), grey wolf optimizer (GWO), and ant colony optimization (ACO)) and a group method of data handling (GMDH) algorithm to delineate groundwater potential zones in Boroujen, Iran. The spatial datasets were created using twelve conditioning factors and spring data (429 locations). The mentioned dataset was divided into two training (70%) and validation (30%) groups. The weights generated from the frequency ratio (FR) method were utilized as modeling inputs. The groundwater potential maps were created using the GMDH, GMDH-PSO, GMDH-GWO, and GMDH-ACO algorithms. With an area under the receiver operating characteristic curve (AUC-ROC) of 87.4%, the GMDH-PSO algorithm outperformed the GMDH-GWO, GMDH-ACO, and GMDH algorithms, which had AUC-ROC values of 85.1%, 83.3% and 80.3%, respectively. Furthermore, the regression relief (Rrelief) method revealed that rainfall, land use/cover, and altitude play a greater role in groundwater assessment. The findings of this research could help with groundwater resource management and groundwater investment planning for long-term sustainability.