Market sentiment has become more easily spread between cities through social media. This study investigates the spatial effect of market sentiment on housing price in a social media environment. In order to extract home-buyer sentiment from social media, we use text sentiment analysis techniques and build a novel housing market sentiment index. A spatial econometric model of housing price volatility is subsequently constructed and the housing market sentiment index is included as an independent variable in the model. Using panel data from 30 large and medium-sized cities in China for 20 quarters from 2016 to 2020, the spatial effect of market sentiment on housing price is empirically analyzed by calculating direct and indirect effects. The results show that market sentiment had a significant positive effect on housing prices in the local and neighboring cities over the research period. However, the impact of market sentiment on housing price was heterogeneous in terms of geographical region; the direct effect was stronger in the eastern region than in the central and western regions, and the indirect effect was significant only in the eastern region. These findings can provide references for government to formulate housing market regulation policies and measures based on market sentiment.