The current study examined the phylogenetic pattern of medicinal species of the family Apiaceae based on flavonoid groups production, as well as the overall mechanism of the key genes involved in flavonol and flavone production. Thirteen species of the family Apiaceae were used, including Eryngium campestre from the subfamily Saniculoideae, as well as Cuminum cyminum, Carum carvi, Coriandrum sativum, Apium graveolens, Petroselinum crispum, Pimpinella anisum, Anethum graveolens, Foeniculum vulgare, Daucus carota, Ammi majus, Torilis arvensis, and Deverra tortuosa from the subfamily Apioideae. The seeds were cultivated, and the leaves were collected to estimate flavonoids and their groups, physiological factors, transcription levels of flavonol and flavone production-related genes. The phylogenetic relationship between the studied species was established using the L-ribosomal 16 (rpl16) chloroplast gene. The results revealed that the studied species were divided into two patterns: six plant species, E. campestre, C. carvi, C. sativum, P. anisum, An. graveolens, and D. carota, contained low content of flavonoids, while the other seven species had high content. This pattern of flavonoids production coincided with the phylogenetic relationships between the studied species. In contrast, the phylogeny of the flavonol and flavone synthase genes was incompatible with the quantitative production of their products. The study concluded that the increment in the production of flavonol depends on the high expression of chalcone synthase, chalcone isomerase, flavanone 3 hydroxylase, flavonol synthase, the increase of Abscisic acid, sucrose, and phenyl ammonia lyase, while flavone mainly depends on evolution and on the high expression of the flavone synthase gene.