A novel optical fiber integrated optoelectrode was proposed and miniatured photoelectrochemical (PEC) sensor was realized. In the structure, transparent conductive oxide indium-tin-oxide (ITO) film and photocatalytic material are coated outside of one end of the optical fiber. This tiny optoelectrode first simultaneously realizes the light-guiding ability and the microelectrode function of electroanalysis. Specifically, the detection of trace nitrite is realized by PEC process of the optical fiber/ITO/BiOI optoelectrode. The integrated optoelectrode shows remarkable electrochemical performance, and the sensor has notable PEC detection ability. At the optimal photosensitizer concentration, the optoelectrode sensor has a linear range of 1 nM–1 M and a low detection limit of 5 10−10 M for the nitrite sensing. Due to the advantages of integration, fast detection, high sensitivity, and simple operation, the proposed optoelectrode has great potentials in a variety of fields, such as all-fiber integrated devices and various biochemical microanalyses systems.