A three-dimensional magnetic hollow porous raspberry-like hierarchical Co/Ni@carbon microspheres (3D Co/Ni@carbon) were synthesized by using a bimetal-organic framework (Co/Ni-MOF) as a precursor and subsequent calcination under nitrogen. The 3D Co/Ni@carbon is a novel solid phase extractant that displays outstanding extraction capability and separation efficiency for the pyrethroid pesticides ethofenprox and bifenthrin. This is ascribed to the beneficial effects of facile analyte transport (due to the presence of free pores), the abundant number of adsorption sites (which warrant efficient extraction), and the excellent structural stability of the material. The 3D Co/Ni@carbon was applied to dispersive magnetic solid-phase extraction (d-MSPE), and the two pyrethroids were quantified by HPLC (UV detection wavelength: 220 nm). The method has a high preconcentration factor (937-1012) and give recoveries that range between 85.6-106.9%, with RSDs (for n = 5) of <6% in case of real samples. Graphical abstract The hierarchical porous Co/Ni@carbon microsphere as adsorbent was fabricated, and it showed high extraction efficiency for two pyrethroids.