<span>Efficient traffic management poses a significant challenge in smart cities, requiring the integration of diverse approaches. This paper presents an artificial intelligence framework that integrates internet of things (IoT) road traffic data to optimize traffic flow in smart city environments. Real-time traffic data is collected using IoT edge sensors, processed using machine learning (support vector machines, logistic regression, k-nearest neighbors) and deep learning long short-term memory (LTSM) algorithms, and utilized to develop accurate short-term and long-term traffic forecasting models. The proposed framework showcases superior performance compared to existing approaches, making it a widely applicable solution for smart city traffic management. By leveraging IoT road traffic data and artificial intelligence (AI) techniques, real-time monitoring, proactive decision-making, and dynamic traffic control can be achieved, leading to optimized traffic flow, reduced congestion, and enhanced urban mobility. This research provides valuable insights into the potential of IoT and AI technologies in addressing urban traffic challenges and lays the foundation for intelligent transportation systems in smart city environments.</span>