Anomaly detection in city traffic is playing a key role in intelligent transportation systems. Anomalies can be caused by different factors, such as accidents, extreme weather conditions or rush hours. In this paper, we propose a method which can detect anomalies in city traffic by analyzing the historical dataset collected from smart city sensors. The proposed Occupancy based anomaly detection algorithm (OBADA) is analyzing occupancy data of the roads, by searching for subsequence of major changes in values in the occupancy's time series which reflects an inordinate behavior. This was done by transforming the time series with a derivative estimation model, into a symbolic representation sequence. To detect the anomalies in the symbolic sequence, the modified z-score method was used. We have also introduced an enhancement by proposing a majority voting technique (OBADA_MV). The OBADA algorithm was evaluated using a historical dataset generated by the Simulation of Urban Mobility (SUMO) framework. By studying four different congestion scenarios, the results have shown that our algorithm can identify anomalies with more than 95% accuracy. OBADA was evaluated by comparing with other methods as well. The results have shown that OBADA anomalies Detection Rate (DR) is 100% and False Alarm Rate (FAR) is 0% which outperformed other methods, but this requires a higher time for detection.