BackgroundAffective states, including sentiment and emotion, are critical determinants of health. However, few studies among men who have sex with men (MSM) have examined sentiment and emotion specifically using real-time social media technologies. Moreover, the explorations on their associations with sexual and health status among MSM are limited.ObjectiveThis study aimed to understand and examine the associations of affective states with sexual behaviors and health status among MSM using public data from the Blued (Blued International Inc) app.MethodsA total of 843,745 public postings of 377,610 MSM users located in Guangdong were saved from the Blued app by automatic screen capture. Positive affect, negative affect, sexual behaviors, and health status were measured using the Simplified Chinese Linguistic Inquiry and Word Count. Emotions, including joy, sadness, anger, fear, and disgust, were measured using the Weibo Basic Mood Lexicon. A positive sentiment score and a positive emotion score were also calculated. Univariate and multivariate linear regression models on the basis of a permutation test were used to assess the associations of affective states with sexual behaviors and health status.ResultsA total of 5871 active MSM users and their 477,374 postings were finally selected. Both positive affect and positive emotions (eg, joy) peaked between 7 AM and 9 AM. Negative affect and negative emotions (eg, sadness and disgust) peaked between 2 AM and 4 AM. During that time, 25.1% (97/387) of negative postings were related to health and 13.4% (52/387) of negative postings were related to seeking social support. A multivariate analysis showed that the MSM who were more likely to post sexual behaviors were more likely to express positive affect (beta=0.3107; P<.001) and positive emotions (joy: beta=0.027; P<.001), as well as negative emotions (sadness: beta=0.0443; P<.001 and disgust: beta=0.0256; P<.001). They also had a higher positive sentiment score (beta=0.2947; P<.001) and a higher positive emotion score (beta=0.1612; P<.001). The MSM who were more likely to post their health status were more likely to express negative affect (beta=0.8088; P<.001) and negative emotions, including sadness (beta=0.0705; P<.001), anger (beta=0.0058; P<.001), fear (beta=0.0052; P<.001), and disgust (beta=0.3065; P<.001), and less likely to express positive affect (beta=−0.0224; P=.02). In addition, they had a lower positive sentiment score (beta=−0.8306; P<.001) and a lower positive emotion score (beta=−0.3743; P<.001).ConclusionsThe MSM social media community mainly expressed their positive affect in the early morning and negative affect after midnight. Positive affective states were associated with being sexually active, whereas negative affective states were associated with health problems, mostly about mental health. Our finding suggests the potential to deliver different health-related intervention strategies (eg, psychological counseling and safe sex promotion) on a social media app according to the affective states of MSM in real time.