Theoretical modeling of X-ray absorption near-edge structure (XANES) spectra is often performed to interpret experimental spectra and to relate spectral features to the atomic and electronic structure of materials. The sensitivity of the XANES spectra to coordination environment, oxidation state and structural disorder is explored using FEFF and FDMNES simulation codes. With a suitable configuration of these instruments, one can also explore the quantitative characteristics of the studied materials, such as lattice constant, nanoparticle geometry, coordination numbers and longer-range ordering. However, fine-tuning the input parameters is often resource-consuming and non-intuitive. We test the application of the Bayesian optimization (BO) algorithm in finding the most optimal simulation parameters for the theoretical XANES spectra and compare the results using different spectrum similarity metrics. The BO method outperforms the random search technique by a factor of three in speed and shows that the correlation-based metrics provide better shape-level agreement than those defined as normalized distance.