Due to the continuous rise of house prices, the Second-hand housing market is becoming more and more prosperous in large-scale cities. This paper will comprehensively consider the attributes of Second-hand houses and surrounding environmental factors, and make a prediction of the transaction price of Second-hand houses in Beijing using the GBDT regression algorithm, a classical algorithm in fields of ensemble learning. The experimental data comes from a well-known Second-hand housing trading platform in China, and we use the public map service API to collect the information of supporting facilities around the searched Second-hand house. Besides, we use Tableau to visually analyze the data in the preprocessing process. PSO algorithm is used to adjust the parameters of GBDT algorithm to improve its performance. Through computational experiments, based on a large number of actual transaction data, it is verified that the proposed prediction algorithm is better than lasso regression algorithm on a number of evaluating indicators.