Aiming at the problem of low accuracy in predicting the spontaneous combustion temperature of coal in goaf, a GAT-Informer model based on graph attention network (GAT) and Informer model is proposed to effectively extract the spatiotemporal characteristics of coal spontaneous combustion monitoring data. Firstly, the random forest regression method and Savitzky Golay filter are used to preprocess the outliers and noise in the coal spontaneous combustion monitoring data. Secondly, based on historical monitoring data, the GAT module is used to extract spatial features between each monitoring point. Then, the Informer model is used to capture the temporal characteristics between the data. Finally, based on the fusion of spatiotemporal features, the coal temperature is predicted. The experimental results show that the coal spontaneous combustion temperature prediction model based on GAT-Informer outperforms single RNN, LSTM, GRU, and Informer prediction models on multi monitoring data. At six monitoring points, the MSE decreased by an average of 15.70%, 22.15%, 25.46%, and 36.48%, and the MAE decreased by an average of 16.00%, 14.58%, 20.29%, and 26.26%, respectively. This indicates that the GAT Informer model can effectively improve the accuracy of coal temperature prediction, prevent disasters caused by coal spontaneous combustion in goaf areas, and has important practical significance for the safety production of coal mines.