Purpose: Reconstructing the energy spectrum from three linear accelerators (LINACs) using experimental measurements of the percentage depth dose curve (PDD). Methods: The experimentally obtained percentage depth dose curves were used to solve the Fredholm integral equation. The photon beam spectra are linked to radiation doses through a Fredholm integral equation, utilizing the optimization method of generalized simulated annealing. The resulting spectrum was employed to simulate a reference condition as recommended by TRS-398. The Monte Carlo codes employed in this study were PENELOPE and TOPAS. Results: The calculated spectra from the three linear accelerators (LINACs) exhibited an impressive level of concordance, reaching up to 99%. The validation of this reconstructed spectrum was executed through a meticulous comparison with the percentage depth dose (PDD) curves, which unveiled a highly favourable correspondence in their behaviour. A comprehensive analysis was conducted to compare the PDDs acquired through experimentation with those simulated using the reconstructed spectrum. Parameters of importance, including the entrance dose, maximum dose, and TPR20/10, were derived from the PDD curves. Upon conducting a thorough comparison of these parameters with the experimental dataset, noticeable deviations of 10%, 1%, and 3% were observed. Conclusions: The present study encompassed the reconstruction of the photon beam spectrum originating from three Accelerator Linacs (ALs), revealing a noteworthy level of agreement among them. The validation of the Fredholm integral equation through the utilization of two simulation codes, as facilitated by the analysis of Percentage Depth Dose (PDD) curves, unveiled substantial disparities within the region leading up to the build-up point. This reconstructed spectrum holds considerable potential for emulating scenarios within the field of radiotherapy applications. This significance is particularly underscored by the challenges associated with acquiring comprehensive data from manufacturers of ALs, which impedes access to crucial information regarding the constituents of these accelerators.