A gas detection method based on CH3NH3PbI3 (MAPbI3) and poly (3,4-ethylenedioxythiophene): poly (4-styrene sulfonate) (PEDOT:PSS) composite photodetectors (PDs) is proposed. The operation of the PD primarily relies on the photoelectric effect within the visible light band. Our study involves constructing a gas detection system based on tunable diode laser spectroscopy (TDLAS) and MAPbI3/PEDOT:PSS PD, and O2 was selected as the target analyte. The system has achieved a minimum detection limit (MDL) of 0.12% and a normalized noise equivalent absorption coefficient (NNEA) of 8.83 × 10−11 cm-1⋅W⋅Hz-1/2. Furthermore, the Allan deviation analysis results indicate that the system can obtain sensitivity levels as low as 0.058% over an averaging time of 328 seconds. This marks the first use of MAPbI3/PEDOT:PSS PD in gas detection based on TDLAS. Despite the detector's performance leaves much to be desired, this innovation offers a new approach to developing spectral based gas detection system.