Taxi services have long faced difficulties with unethical taxi drivers taking detours, especially when passengers are unfamiliar with their surroundings. Therefore, it is important to monitor taxis’ operation to enhance the quality of taxi services. In this paper, we mainly study the anomaly detection of taxi trajectories in the spatial dimension with a novel taxi anomaly detection framework based on real-time vehicle trajectory prediction. The framework is termed as TAPS and consists of two stages: the offline training stage and the online anomaly detection stage. In the first stage, a vehicle prediction model is established by training recommended routes provided by a navigation platform to predict a taxi’s next locations. The second step is to detect the taxi’s anomalous trajectories by measuring the consistency between its current and predicted positions as well as the relationship between these two positions and the origin. The effectiveness and timeliness of TAPS are evaluated in a real-world case study. The experiment results show that compared with two baselines, TAPS achieves greater Accuracy, Precision and F1 score to detect anomalous trajectories. This proposed framework can serve as a fundamental tool to detect anomalous trajectories for taxi passengers and companies.