Trajectory prediction is a key task in the study of human mobility. This task can be done by considering a sequence of GPS locations and using different mechanisms to predict the following point that will be visited. The trajectory prediction is usually performed using methods like Markov Chains or architectures that rely on Recurrent Neural Networks (RNN). However, the use of Transformers neural networks has lately been adopted for sequential prediction tasks because of the increased efficiency achieved in training. In this paper, we propose AP-Traj (Attention and Possible directions for TRAJectory), which predicts a user’s next location based on the self-attention mechanism of the transformers encoding and a directed graph representing the road segments of the area visited. Our method achieves results comparable to the state-of-the-art model for this task but is up to 10 times faster.