South Korea’s Particulate Matter (PM) concentration is among the highest among Organization for Economic Cooperation and Development (OECD) member countries. However, many studies in South Korea primarily focus on housing characteristics and the physical built environment when estimating apartment prices, often neglecting environmental factors. This study investigated factors influencing apartment prices using transaction data for Seoul apartments provided by the Ministry of Land, Infrastructure, and Transport (MOLIT) in 2019. For this purpose, the study compared and analyzed a traditional hedonic price model with a machine learning-based random forest model. The main findings are as follows: First, the evaluation results of the traditional hedonic price model and the machine learning-based random forest model indicated that the random forest model was found to be more suitable for predicting apartment prices. Second, an importance analysis using Explainable Artificial Intelligence (XAI) showed that PM is more important in determining apartment prices than access to education and bus stops, which were considered in this study. Finally, the study found that areas with higher concentrations of PM tend to have higher apartment prices. Therefore, when proposing policies to stabilize apartment prices, it is essential to consider environmental factors. Furthermore, it is necessary to devise measures such as assigning PM labels to apartments during the home purchasing process, enabling buyers to consider PM and obtain relevant information accordingly.