Genetic diversity and Agro-climatic conditions contribute significantly to the agronomic and morphological features of the food plant species, and their nutraceutical potential. The present study was intended to evaluate the impact of growing conditions on total phenolic and total flavonoid contents, and in vitro antioxidant potential in the bulbs and leaves of onion varieties planted under diverse environmental conditions. Standard analytical methods were used to quantify total phenolic content (TPC), total flavonoid content (TFC), and free radicals’ scavenging/antioxidant capacity. The impact of climatic and soil conditions was assessed using statistical tools. In general, onion varieties cultivated at three different locations viz. Kalar Kahar, Lahore and Swabi exhibited significant variations in TPC and TFC, and antioxidant activities. The bulbs and leaves of Mustang (V1) variety planted at Lahore and Swabi had significantly (p < 0.05), high levels of TPC (659.5 ± 6.59, and 631.1 ± 8.58 mg GAE/100 g, respectively). However, leaves of Red Orb (V2) and bulbs of Mustang (V1), and Golden Orb (V6), harvested from Kalar Kahar depicted the highest concentration of TFC (432.5 ± 10.3, 303.0 ± 6.67, and 303.0 ± 2.52 mg QE/100 g DW, respectively). Likewise, bulbs of V1 planted at Kalar Kahar, Lahore and Swabi exhibited maximum inhibition of DPPH, ABTS, and H2O2 radicals (79.01 ± 1.49, 65.38 ± 0.99, and 59.76 ± 0.90%, respectively). Golden Orb (V6) harvested from Lahore had the highest scavenging of OH radical (67.40 ± 0.09%). Likewise, bulbs of V1 variety planted at KalarKahar and Swabi had significant capacity to scavenge ferric ions (415.1 ± 10.6 mg GAE/100 g DW), and molybdate ions (213.7 ± 0.00 mg AAE/100 g DW). Conversely, leaves of Amazon (V8), planted at Lahore and Swabi depicted significant levels of DPPH, ABTS, H2O2 radical scavenging (90.69 ± 0.26, 63.55 ± 1.06, 51.86 ± 0.43%, respectively), and reduction of ferric ions (184.2 ± 6.75 mg GAE/100 g DW). V6 leaves harvested from Lahore and that of Super Sarhad (V3) from Swabi showed the highest inhibition of OH radical (61.21 ± 0.79%), and molybdate ions (623.6 ± 0.12 mg AAE/100 g DW), respectively. Pearson correlation and principal component analysis revealed strong relationships of climatic conditions, soil properties and elevation with TPC, TFC and free radicals’ scavenging potential in the bulbs and leaves of onion varieties. The variations in the total phenolic and flavonoid contents, and antioxidant potential of different varieties, and their associations with climatic and soil factors revealed the complexity of the growing conditions and genetic makeup that imposed significant impacts on the synthesis of secondary metabolites and nutraceutical potential of food and medicinal plant species.