Energy security has moved to the forefront of international policy agendas and boosted efforts to deploy clean energy technologies. In the past few years, clean energy investment has accelerated at a faster rate than investment in fossil fuels, contributing to the emergence of peak oil demand. This study examines the impact of energy use, energy access, and oil price fluctuations on environmental quality in APEC countries between 1991 and 2020 using shadow economies and agricultural lands as moderating variables. The results of the Arellano-bond dynamic panel data estimation show that energy use, energy access, agricultural land, and a shady economy are positively related to CO2 emissions, while oil price fluctuations are negatively associated with CO2 emissions in APEC nations. There is a positive correlation between energy use and carbon dioxide emissions among APEC nations. As energy use increases, CO2 emissions increase as well. APEC nations have a positive relationship between energy access and carbon dioxide emissions. Policymakers in APEC countries must understand the implications of rising energy consumption and CO2 emissions. To mitigate negative environmental consequences, develop sustainable energy sources, and promote economic growth, energy efficiency measures can help to minimize energy consumption and reduce CO2 emissions. APEC countries are encouraged to develop carbon pricing mechanisms to encourage companies to reduce greenhouse gas emissions through cap and trade systems or carbon taxes. The implementation of carbon pricing mechanisms encourages businesses to switch to cleaner, renewable energy sources as a result of putting a price on carbon emissions.