A simple, fast, and sensitive solid phase microextraction method (SPME) has been applied for the enrichment and simultaneous determination of trace and toxic polycyclic aromatic hydrocarbons in water and wastewater samples. This method is based on the adsorption of these volatile compounds on a new robust fiber built from anodized aluminum wire coated with g-C3N4. Extraction of the analytes from different matrices on the fiber surface was performed by headspace mode (HS-SPME) at optimized conditions. This proposed method was used to determine trace amounts of some polycyclic aromatic hydrocarbons (PAHs) in real water and wastewater samples and provided good repeatability with a low limit of detection (LOD).