In this study, a new electrochemical strategy based on the fabrication of a molecularly imprinted sensor onto a MoS 2 -loaded peanut shell carbon complex with gold nanoparticles (AuNPs) and nitrogen-doped carbon dots (N-CDs) was proposed for the detection of benzo(a)pyrene (BaP). Molecularly imprinted polymer (MIP) films were prepared by cyclic voltammetry (CV) using 2-mercaptobenzimidazole (2-MBI) as a functional monomer in the presence of BaP. The surface morphologies, structural characteristics and electrochemical properties of the obtained MIP/AuNPs/N-CDs/PSBC/MoS 2 /GCE were investigated via scanning electron microscopy (SEM), transmission electron microscopy (TEM), energy-dispersive spectrometry (EDS), Fourier transform infrared spectrometry (FTIR), X-ray diffraction (XRD), UV-Vis spectrometry, fluorescence spectrometry, cyclic voltammetry (CV) and electrochemical impedance spectroscopy (EIS). Under the optimised conditions, the detection range of the electrode towards BaP varied from 5 nM to 20 μM with a detection limit of 1.5 nM. The prepared electrochemical sensor also exhibited good stability, relevant reproducibility and high selectivity. The application of the sensor in the actual analysis of edible oil samples showed promising results, thereby being relevant as a biomimetic sensing platform for the detection of chemical hazards in food and environment.Keywords Benzo(a)pyrene, electrochemical sensor, molecularly imprinted polymer, nitrogen-doped carbon dots, peanut shell carbon.