Daucus capillifolius Gilli is a rare annual wild herb grown in Libya. It belongs to the Apiaceae family, which is one of the largest flowering plant families. Plants of this family are outstanding sources of various secondary metabolites with various biological activities. A UPLC-ESI-MS/MS analysis of different extracts of in vivo and in vitro tissues of Daucus capillifolius together with the fruit extract of the cultivated plant in both ionization modes was carried out for the first time in the current study. Our results reveal the tentative identification of eighty-seven compounds in the tested extracts, including thirty-two phenolic acids and their derivatives; thirty-seven flavonoid glycosides and aglycones of apigenin, luteolin, diosmetin, myricetin and quercetin, containing glucose, rhamnose, pentose and/or glucuronic acid molecules; seven anthocyanins; six tannins; three acetylenic compounds; and three nitrogenous compounds. The tentative identification of the above compounds was based on the comparison of their retention times and ESI-MS/MS fragmentation patterns with those previously reported in the literature. For this Apiaceae plant, our results confirm the presence of a wide array of secondary metabolites with reported biological activities. This study is among the first ones to shed light on the phytoconstituents of this rare plant.