In this study, a new algorithm for recommending movies to viewers has been proposed. To do this, the suggested method employs data mining techniques. The proposed method includes three steps for generating recommendations: “preprocessing of user profile information,” “feature extraction,” and “recommendation.” In the first step of proposed method, the user information will be examined and transformed into a form that can be handled in the next phases. In the second step of the proposed method, user attributes are then extracted as a collection of their individual qualities, as well as the average rating of each user for various genres. The bee colony optimization algorithm is then used to select the optimal features. Finally, in the third step of the proposed method, the ratings of similar users are utilized to offer movies to the target user, and the similarities between various users are determined using the characteristics calculated for them, as well as the Euclidean distance criteria. The proposed method was evaluated using the MovieLens database, and its output was assessed in terms of precision and recall criteria; these results show that the proposed method will increase the precision by an average of 1.39% and the recall by 0.8% compared to the compared algorithms.