We report on a nanostructured self-doped polypyrrole (SPPy) film that was prepared by an electrochemical technique in an electrolyte containing fluorosulfonic acid as the sulfonation reagent. The film was applied as a new fiber material for solid-phase microextraction (SPME) of the pesticides lindane, heptachlor, aldrin, endosulfans I and II prior to their quantitation by GC with electron capture detection. The SPPy nanoparticles have a diameter of <100 nm. The introduction of covalently bound sulfo groups into the backbone of the polymer resulted in improved temperature resistance (~350°C) and satisfactory extraction efficiency. The thermal stability of the SPPy fiber is superior to common polypyrrole fibers. Extraction was optimized by means of the Taguchi orthogonal array experimental design with an OA 16 (4 5 ) matrix including extraction temperature, extraction time, salt concentration, stirring rate, and headspace volume. The method displays good repeatability (RSD<6%) and linearity (in the range from 0.78 to 100 ng mL −1 ; with an R 2 of >0.998. The detection limits are <0.23 ng mL −1 . The method was successfully applied to the analysis of the pesticides in skimmed milk and fruit juice samples, and recoveries are from 84±1 to 105±1%.