Predicting the future trajectories of multiple pedestrians in certain scenes has become a key task for ensuring that autonomous vehicles, socially interactive robots and other autonomous mobile platforms can navigate safely. The social interactions between people and the multimodal nature of pedestrian movement make pedestrian trajectory prediction a challenging task. In this paper, the problem is solved using a generative adversarial network (GAN) and a graph attention network (GAT) based on the spatiotemporal interaction information about pedestrians. Our method, STI-GAN, is based on an end-to-end GAN model that simulates the pedestrian distribution to capture the uncertainty of the predicted paths and generate more reasonable future trajectories. The complex interactions between people are modeled by a GAT, and spatiotemporal interaction information is used to improve the performance of trajectory prediction. We verify the robustness and improvement of our framework by evaluating its results on various datasets and comparing them with the results of several existing baselines. Compared with the existing pedestrian trajectory prediction methods, our method reduces the average displacement error (ADE) and final displacement error (FDE) by 21.9% and 23.8% respectively.