A core-shell structure of hydroxy-functionalized Schiff-base based on polyimides (PSB) modified with magnetic nanoparticles (Fe3O4@PSB) has been synthesized. The Fe3O4@PSB was employed as a magnetic solid-phase extraction (MSPE) sorbent for the extraction and determination of trace non-steroidal anti-inflammatory drugs (NSAIDs) i.e. naproxen, diclofenac, and ibuprofen in environmental samples followed by high-performance liquid chromatography (HPLC). The structure of Fe3O4@PSB was characterized by TEM, TGA, VSM, EDS map-ping, FT-IR, 1H NMR, and 13C NMR analyses to confirm the immobilization of Fe3O4 on PSB. The effective factors, such as desorption solvent, sorbent amount, extraction and desorption time, ionic strength, and sample pH were tuned to obtain the optimal extraction conditions. The calibration curve is linear in the range of 0.05–300 ng mL.