The study evaluated endophytic communities associated with five oil-bearing plants, including sesame, corn, sunflower, olives and castor, which were collected from Baghdad and Diyala (Iraq), evaluated their oil production capacity and identified metabolites from the lipid fraction. Out of 151 isolates were collected from 21 taxa. Aspergillus niger showed the highest frequency (6.62 %), while the genera Aspergillus and Fusarium were the most dominant endophytes. The highest oil yield was identified and recorded in Aspergillus terreus (24.12 %). While the lowest oil yield was observed in Sclerotinia spp. (3.96 %). Gas chromatography-mass spectrometry (GC-MS) analysis of A. terreus revealed a profile dominated by pentadecyl acrylate (21.0 %) and ethyl palmitate (20.01 %), with methyl stearate as the minor component (1.37 %). These results highlight biodiesel raw material and pharmacist-relevant metabolites, such as sources of metabolites.