A stir bar sorptive extraction (SBSE) technique was developed by the use of polypyrrole (PPy) sorbent, electropolymerized on the surface of a rod, as a possible alternative to solid‐phase microextraction (SPME). Liquid desorption was subsequently employed to transfer the extracted analytes into the injection port of a gas chromatography‐mass spectrometry (GC‐MS). The PPy sorbent including polypyrrole‐dodecyl sulfate (PPy‐DS) was deposited on the surface of a stainless steel rod from the corresponding aqueous electrolyte by applying a constant deposition potential. The developed method was applied to the trace level extraction of BTEX (benzene, toluene, ethylbenzene, o,p‐xylene) from aqueous sample. Optimization of influential experimental conditions including the voltage of power supply, the time of PPy electrodeposition, the extraction temperature, the ionic strength and the extraction time were also investigated. The detection limits of the method under optimized conditions were in the range of 0.01–0.1 ng·mL−1. The relative standard deviations (RSD) at a concentration level of 1 ng·mL−1 were obtained between 8% and 13% (n=6). The calibration curves of BTEX showed linearity in the range of 0.03 to 600 ng·mL−1. The proposed method was successfully applied to the extraction of some selected BTEX from river water samples and the relative recoveries were higher than 90% for all the analytes.