The aim of this study was to develop a new method for the determination of benzene, toluene, ethylbenzene and xylene isomers (BTEXs) in urine samples. In this method, MIL‐100(Fe)@Fe3O4@SiO2 metal–organic framework was synthesized, characterized and packed inside a needle trap device (NTD) as a sorbent for headspace extraction of unmetabolized BTEXs from urine samples followed by gas chromatography (GC) analysis. The GC device was equipped with a flame ionization detector (FID). The results showed that the optimal extraction time, extraction temperature and salt content were 60 min, 30°C and 5%, respectively. Also, the optimal desorption time and temperature were determined to be 1 min and 250°C, respectively. The limits of detection and quantification of the analytes of interest were in the ranges 0.0001–0.0005 and 0.0003–0.0014 μg ml−1, respectively. The intra‐ and inter‐day repeatability were <7.6%. The accuracy of the measurements in urine samples was in the range 7.1–11.4%. The results also demonstrated that the proposed NTD offered various advantages such as having high sensitivity and being inexpensive, reusable, user friendly, environmentally friendly and compatible for use with the GC device. Therefore, it can be efficiently used as a MIL–NTD for the extraction and analysis of unmetabolized BTEXs from urine samples.