This paper produces a real-time air quality index dataset of three places named Kuril Bishow Road, Uttara, and Tongi in Dhaka and Gazipur City, Bangladesh. The IoT framework consists of MQ9, MQ135, MQ131, and dust or PM sensors with an Arduino microcontroller to collect real data on sulfur dioxide, carbon monoxide, nitrogen dioxide, ozone, particle matters 2.5 and 10 µm. The data is stored in an Excel file as a comma-separated file and after that, authors applied regression type and classification type machine learning algorithms to analyze the data. The dataset consists of 11 columns and 155,406 rows, where sulfur dioxide, carbon monoxide, nitrogen dioxide, ozone, and particle matter 2.5 and 10 are recorded where AQI is marked as the target variable and the others are indicated as independent variables. In the dataset, AQI is categorized into five classes named Good, satisfactory, Moderate, Poor and Very Poor. After experimental results, it is seen that two places including Uttara and Kuril are comparatively suitable for Air Quality among the three places as well as the Random Forest algorithm outperforms the models. The study describes details of the embedded system's hardware as well. This dataset will be beneficial for environmental researchers to use to analyze the air quality.