In this paper, a Firefly algorithm is proposed for identification and comparative study of five, seven and eight parameters of a single and double diode solar cell and photovoltaic module under different solar irradiation and temperature. Further, a metaheuristic algorithm is proposed in order to predict the electrical parameters of three different solar cell technologies. The first is a commercial RTC mono-crystalline silicon solar cell with single and double diodes at 33 • C and 1000 W/m 2. The second, is a flexible hydrogenated amorphous silicon a-Si:H solar cell single diode. The third is a commercial photovoltaic module (Photowatt-PWP 201) in which 36 polycrystalline silicon cells are connected in series, single diode, at 25 • C and 1000 W/m 2 from experimental current-voltage. The proposed constrained objective function is adapted to minimize the absolute errors between experimental and predicted values of voltage and current in two zones. Finally, for performance validation, the parameters obtained through the Firefly algorithm are compared with recent research papers reporting metaheuristic optimization algorithms and analytical methods. The presented results confirm the validity and reliability of the Firefly algorithm in extracting the optimal parameters of the photovoltaic solar cell.