An electronic device includes a housing, a communication module positioned inside the housing, a processor positioned inside the housing and operatively connected with the communication module, a sensor module operatively connected with the processor, and a memory positioned inside the housing and operatively connected with the communication module, the sensor module, and the processor. The memory stores instructions configured to, when executed, enable the processor to gather data related to a first user, send a request for a user group corresponding to a first category among a plurality of categories to an external server using the communication module, obtain the user group corresponding to the first category based on at least part of the data related to the first user from the external server using the communication module, and provide information about at least one second user in the obtained user group.