ABSTRACT
Background and Aims Social media can provide real-time insight into trends in substance use, addiction, and recovery. Prior studies have leveraged data from platforms such as Reddit and X (formerly Twitter), but evolving policies around data access have threatened their usability in opioid overdose surveillance systems. Here, we evaluate the potential of a broad set of platforms to detect emerging trends in the opioid crisis.
Design We identified 72 online platforms with a substantial global user base or prior citations in opioid-related research. We evaluated each platform’s fit with our definition of social media, size of North American user base, and volume of opioid-related discourse. We created a shortlist of 11 platforms that met our criteria. We documented basic characteristics, volume and nature of opioid discussion, official policies regulating drug-related discussion, and data accessibility of shortlisted platforms.
Setting USA and Canada.
Measurements We quantified the volume of opioid discussion by number of platform-specific Google search hits for opioid terms. We captured informal language by including slang generated using a large language model. We report the number of opioid-related hits and proportion of opioid-related hits to hits for common nouns.
Findings We found that TikTok, YouTube, and Facebook have the most potential for use in opioid-related surveillance. TikTok and Facebook have the highest relative amount of drug-related discussions. Language on TikTok was predominantly informal. Many platforms offer data access tools for research, but changing company policies and user norms create instability. The demographics of users varies substantially across platforms.
Conclusions Social media data sources hold promise for detecting trends in opioid use, but researchers must consider the utility, accessibility, and stability of data on each platform. A strategy mixing several platforms may be required to cover all demographics suffering in the epidemic.
INTRODUCTION
Real-time tracking of substance use trends is key to understanding epidemics of addiction and overdose, including the ongoing North American opioid crisis. Heterogeneity in prominent substances, drug availability, and usage patterns across the epidemic’s distinct waves require different intervention strategies, and it is critical that policy makers are sensitive to these changing dynamics. Currently, academic and government surveys are standard practice for tracking usage patterns. However, difficulties with self-reported opioid use limit the reliability of these surveys, leading to inaccurate estimates of the prevalence and nature of opioid use (1) Moreover, surveys can take months or years to complete and results may not reflect quickly evolving trends in opioid use.
Social media platforms are a promising alternative data source which might be used to track patterns of opioid use. Unlike official overdose statistics, social media provides real-time, high-volume, and widely accessible streams of information (2,3) These platforms capture unfiltered experiences across diverse populations, including encounters with illicit substances that might not otherwise be disclosed. (4) Thus, social media can help researchers identify and geolocate emerging drugs and track practices among people who use opioids (PWUOs). Understanding these patterns could help policymakers anticipate future hotspots for overdoses.
Various models have been trained on social media data to predict individual- and population-level outcomes related to opioid use. By focusing on media from individual users, some researchers have attempted to detect opioid misuse (4), flag indicators of addiction (5), and assess individual risk of relapse (6). A larger body of work is dedicated to tracking population trends in opioid misuse (7) and opioid-related mortality (8,9). Some evidence suggests that language use on these platforms may be more predictive of trends in county-level deaths than factors such as demographics, healthcare access, and physical pain. (8) Other work has triangulated social media data with other surveillance datasets (such as emergency department admissions data) to develop more holistic models.(10)
Most of this work uses only a few well-known platforms, chiefly X (formerly Twitter) and Reddit. However, access to these data sources is highly dependent on corporate decisions that inadvertently impact researchers. For example, Pushshift (11) was a popular research tool for extracting Reddit posts, but when Reddit started to limit API requests for third-party data access in 2023, it effectively disabled Pushshift. A similar phenomenon occurred with the X API contemporaneously. As digital platforms evolve, it is critical for researchers to understand the scope of available datasets and whether there are feasible alternatives if a dataset becomes inaccessible. Additionally, different social media platforms have different constituent demographics; no individual platform fully represents the population at large. Therefore, an effort combining multiple platforms, rather than relying on one or two, may be better able to capture trends in this global crisis.
There are currently no comprehensive studies evaluating the nature, volume, and quality of opioid-related discussions across social media platforms. Although there are several systematic literature reviews of this field (3,12), a direct evaluation of a broad range of social media platforms is needed for researchers seeking to leverage social media platforms to explore opioid use.
Here, we identified social media platforms that may be suitable for text-based opioid research and characterized the nature and volume of their opioid-related discussions. We created a shortlist of eleven platforms for which we investigated censorship policies, data accessibility, and prior use in opioid research. We present our findings and discuss the utility, availability, and stability of these platforms for the purpose of informing design of a social media early-warning system for trends in the opioid epidemic. Code for the analyses contained here is available at https://github.com/kristycarp/opioid-social-media-platforms.
METHODS
Identifying social media platforms
We compiled a comprehensive list of social media platforms that may contain content related to opioid use, substance use disorders, and/or addiction treatment and recovery.
We included all platforms with more than 100M monthly active users worldwide (13). We also included platforms that the Stanford Digital Economy Lab identified as “digital goods” due to their widespread use and relevance (14, personal communication).
We included platforms previously analyzed for surveillance of illicit drug use (15–17) and general adverse drug reactions (15,18–24). We also chose to include several forums dedicated to discussion of drug use and recovery, some of which have been previously used for research on illicit drug use (25). We included popular online marketplaces due to their potential for opioid-related transactions. (26–31)
Creating platform shortlist
In the first round of platform evaluation, we determined if each platform 1) had an active web domain or mobile application, 2) met the Knight First Amendment Institute definition of social media (32), 3) had a primary function other than private messaging, 4) was based in the US/Canada or had English as the default language for US-based users, and 5) returned more than 25,000 Google search hits for a set of opioid-related terms. Platforms that met all five criteria were shortlisted for detailed evaluation. A detailed description of the shortlisting process can be found in Supplement S1.1.
Measuring the volume of opioid-related discussion
We used the number of hits returned by Google search results when querying opioid-related terms to approximate the amount of accessible opioid-related discussion on each platform. We used this proxy method as a fast alternative to acquiring access to all content on each platform. We formatted the Google queries so as to only yield results from the specific platform’s domain, e.g. when assessing Facebook, we limited results to only be those from facebook.com. We assembled three lists of opioid-related terms: “formal,” “informal,” and “algospeak.”
The “formal” opioid term list includes official generic names and common brand names of opioids. These terms are the same as those used to initially select for platforms with high opioid discussion in the platform exclusion phase (Supplement S1.1, Supplement S1.2).
The “informal” opioid term list includes slang terms, misspellings, and other brand names. Because language on social media is often informal, terms like these are important to include to capture the full scale of opioid-related discussion on a given platform. We previously found that GPT-3 (33) is able to quickly and accurately generate slang for drugs of addiction at scale (34). We took validated GPT-3–generated slang terms for five opioids prominent in the opioid epidemic (codeine, fentanyl, morphine, oxycodone, and oxymorphone) which were precomputed by Carpenter et al, and removed terms that had common non-drug meanings in addition to drug-related meanings (e.g. “fenty” is a common slang term for fentanyl, but also the name of a cosmetics brand). To keep the scale similar to that of the formal term analysis, we reduced the list to the top 20 terms most commonly generated by GPT-3 (Supplement S1.3).
“Algospeak” is a phenomenon in which users of social media platforms purposefully alter the spelling of terms in order to evade automated censorship. (35) For example, a poster on social media may refer to fentanyl as “f3ntanyl” to avoid being banned. We noticed that the set of terms generated by GPT-3, while still relevant to present-day casual discussion, did not include algospeak. Therefore, we created an additional “algospeak” term list using GPT-4 in order to capture censorship-evading language on social media (Supplement S1.4). A description of how we created this list is found in Supplement S1.5.
We used the Google Search API with default parameters to query for the number of English-language hits specific to a given social media website for each of the formal opioid terms, informal opioid terms, and algospeak opioid terms. We tabulated the total number of hits per list to quantitatively estimate the total volume of opioid discussion on each of the shortlisted platforms. In addition, we compared the raw number of opioid-related hits to the number of hits returned for a queries of “household terms”, chosen from Corpus Of Contemporary American English to represent the most common nouns used in the English language. (Supplement S1.6) This normalized ratio allowed us to assess how prominent opioid discussion is relative to other content on the platform, regardless of the total number of posts on the platform; platforms with large ratios may be used for opioid discussions more than platforms with small ratios. For each of our three term lists, we calculated a per-platform normalized ratio, defined as the total number of hits for all terms in the list over the total number of hits for all household terms for a given platform, scaled by 100,000 for easier visualization (Equations S1-3). In the following analyses, we add informal and algospeak normalized ratios together as the algospeak terms can be considered a special case of informal terms.
Content restrictions and censorship policies
We analyzed the content restriction and censorship policies of social media sites by directly referencing the sites’ terms of use and user agreement web pages.
Evaluating data accessibility for academic research purposes
We sourced information regarding data accessibility for research purposes from each site’s respective publicly-available information regarding research and API programs.
Assessing prior use of platforms in research literature
We conducted PubMed searches to identify literature relevant to each of the shortlisted platforms that focuses on applications to the opioid epidemic. We searched for articles with the name of the social media platform in the title or abstract (for less commonly studied social media platforms, this criterion was broadened to presence anywhere in the article) and either “opioids”, “opioid”, “opiates”, or “opiate” in the title or abstract.
Example: (twitter[Title/Abstract]) AND (opioids[Title/Abstract] OR opioid[Title/Abstract] OR opiates[Title/Abstract] OR opiate[Title/Abstract])
RESULTS
Identifying social media platforms
We took the union of the platforms found from the various sources listed in Methods to create a superset of 72 candidate platforms (Supplement Table 1).
Creating platform shortlist
We applied our shortlist evaluation criteria to the 72 candidate platforms in an iterative process (Figure 1). Our full assessment of these platforms is included in Table S2.
Consort diagram of iterative exclusion criteria to attain shortlist of 11 social media platforms for further characterization.
Of the original 72 platforms, there were 4 platforms that were not active as of July 2023. There were 21 active platforms that did not meet our definition of social media and 11 active platforms that were primarily a private messaging platform. We found that 11 of the active, social media sites were not based in the United States or did not have English as the default language for a user in the United States. Among the remaining sites, there were 14 platforms that returned fewer than 25,000 query results on the selected opioid keywords.
After applying these criteria, we were left with 11 (15.3%) platforms for further evaluation: Bluelight, drugs-forum.com, Facebook, Instagram, LinkedIn, Pinterest, Reddit, TikTok, Tumblr, X (formerly Twitter), and YouTube.
Characteristics of these platforms are described in Table 1.
“Platform focus” gives a brief description of the primary usage of the platform. “Text data available” lists the types of text content that the platform contains. “Drug discussion not restricted” column has a checkmark if the platform does not restrict drug-related discussion, and an X if the platform has some form of restrictions. “Has API” column has a checkmark if the platform has an API available (whether the API is freely available or requires authorization before access), and an X if not. “Has research portal” column has a checkmark if the platform has a non-API platform for researchers to acquire platform data or for researchers to receive more information about collaboration with the platform, and an X if not. Number of checkmarks in “previously researched for opioid pharmacovigilance” column roughly corresponds to the relative amount of prior research, on a 4-point scale (with more checkmarks indicating relatively more prior research; see “Prior Use in Research Literature” section of Results). “Geolocation available” column has a checkmark if explicit geolocation data is provided for any platform content (this does not indicate explicit geolocation available for all content), and an X if not. “Example of geolocation inference strategy” column provides one possible method for inferring geolocation of platform content.
Measuring the volume of opioid-related discussion
The type and volume of publicly available data related to opioids varied widely across platforms (Figure 2, Figure 3, Figure S1, Table S3, Table S4). We observed the highest total volume of opioid-related discussion – in terms of both formal and informal term hits – on YouTube and Facebook (Figure 2a, Figure S1, Table S3). These were followed by LinkedIn, TikTok, and Reddit. By far, the platforms with the lowest total volume of opioid-related discussion were Bluelight and drugs-forum.
Total hits for each of the shortlisted platforms, shown with a logarithmic scale. Platforms are clustered into three categories by volume of hits, shown by color (darker shade of blue indicates higher volume of hits). Dotted line shows y=x diagonal.
a) Total hits for formal opioid term list versus the sum of the total hits for the informal opioid term list and the algospeak opioid term list.
b) Total hits for informal opioid term list versus algospeak opioid term list.
Term hits normalized by number of hits for common nouns, shown with a logarithmic scale and scaling factor of 100,000. As in Figure 2, platforms are clustered into three categories by total volume of hits, shown by color (darker shade of blue indicates higher volume of hits).
Dotted line shows y=x diagonal.
a) Normalized hit ratios for formal opioid term list versus for informal opioid term list and algospeak opioid term list.
b) Normalized hit ratios for informal opioid term list versus algospeak opioid term list.
Most platforms followed the same linear relationship between the amount of formal opioid terms and the amount of informal (including algospeak) opioid terms. Some slight outliers were TikTok and Instagram, which both skewed toward more informal term hits, and LinkedIn, Reddit, and X, which all skewed toward more formal term hits.
Examining the relationship between the total number of informal hits versus the total number of algospeak hits revealed largely similar trends as the comparison between formal hits and informal hits (Figure 2b). The outliers outside of the trendline on this plot reveal which platforms have more algospeak, indicating a response to censorship. TikTok by far had the most amount of algospeak. Instagram and X also skewed more toward algospeak than to informal, non-algospeak terms. LinkedIn and Reddit both skewed toward more informal term hits than algospeak term hits.
While having less total drug-related discussion overall, Bluelight and drugs-forum had dramatically higher rates of drug discussion relative to non-drug discussion (Figure 3a). This is expected due to their explicit platform focus on drugs. Among the social media platforms with more general scope, TikTok and Facebook had the highest relative amount of drug discussion when compared to non-drug discussion.
We also visualized the relative amounts of informal and algospeak term hits for the 11 platforms (Figure 3b). Again, Bluelight and drugs-forum show large separation from the 9 general social media platforms, especially with respect to informal (non-algospeak) terms. When looking at only the 9 general social media platforms, we saw that Facebook and TikTok again were the two platforms with the highest relative amounts of drug discussion with respect to both informal and algospeak term hits.
Content restrictions and censorship policies
All eleven shortlisted platforms make statements in their terms of use or community standards about expectations regarding and moderation of drug-related discussion. High-level classifications of drug-related content policies are shown in Table 1. We provide excerpts of each platform’s community standards relevant to drug-related discussion in Supplement S1.7.
At a minimum, all eleven platforms explicitly state that the sale of illicit substances is not allowed. Facebook, Instagram, TikTok, and YouTube go further to state that posting content related to or promoting recreational use of drugs is prohibited. TikTok additionally underscores that such content is particularly dangerous for young people. These platforms make exceptions for recovery-oriented or educational content. Similarly, LinkedIn prohibits depictions of “drug abuse.” Reddit has some communities focused on drug-related discussion, and therefore is more tolerant; the Reddit content moderation system accounts for communities with mature themes, such as drug-related discussion, and places these communities under age restrictions. Bluelight and drugs-forum, as forums dedicated to drug-related discussion, are distinct from the other, general-purpose social media platforms. Both Bluelight and drugs-forum explicitly state that they are safe spaces for discussion of all aspects of drug use and recovery.
Evaluating data accessibility for academic research purposes
Many platforms provide Application Programming Interfaces (APIs) for data extraction. Generally, APIs are available in tiers where more expensive versions provide more comprehensive access. Research APIs often provide free or heavily discounted access to users who can verify their affiliation with a research institute. In some cases, outside groups have maintained third-party APIs; for example, Pushshift was a free, popular tool to query data from Reddit. We found that smaller drug-focused forums do not have data access APIs or third-party tools that allow for easy data extraction. We provide an overview of data access capabilities in Table 1 and per-platform details in Supplement S1.8. We emphasize that researchers should not violate platform terms of service when collecting data for pharmacovigilance or any other purpose.
Beyond accessing text content of these platforms, a useful early-warning system for trends in the opioid epidemic necessitates geolocatability. The geolocation of social media content can be obtained directly from the platform or, when such metadata is unavailable, inferred.
Some social media platforms explicitly provide geolocation of users or posts. X (formerly Twitter) gives platform users the option to explicitly geotag their tweets. While only a small subset of users opt to do this (under 2% (36)), the fact that this information is present on the platform in some regard means that it can be harnessed by researchers. Many groups have leveraged explicit tweet geotagging for opioid-related research (37–43) and other research areas (44,45). These studies typically only analyze tweets with geotags. It is important to note that it was possible to geotag a tweet with explicit latitude and longitude coordinates only until June 2019; since then, users can only tag tweets with place objects that have coordinate bounding boxes. (36,46,47)
Similarly, Facebook (48), Instagram (49–52), and YouTube (53–55), give users the option to tag their content with geolocations. However, it is important to note that these tags can be used for purposes other than reporting the exact location from where the post was made (56). Facebook additionally has a Data for Good program (57) which includes province-level GPS data from a subset of consenting users; researchers have leveraged this data to study phenomena related to the COVID-19 pandemic (58,59). State et al. used provided user and company locations to track migration patterns using LinkedIn (60)].
The geolocatability of TikTok users has been a prominent topic of discussion in the US. (61–63) Like many other prominent social media platforms, TikTok uses user location to personalize their content feed and allows users to optionally add a location tag to their videos (64). Various groups have characterized the privacy aspect of geolocation on TikTok (65,66), but there is little research using tagged locations for geographically-informed analysis. However, Zanettou et al. recruited consenting users to donate their geotagged data, which each user can request under the EU’s GDPR regulation. (67)
Forums have a unique way of presenting geolocation information. Many online forums allow users to indicate their location in a designated field on their profile. This is required on drugs-forum and optional on Bluelight. These location entries are unstandardized free text and can be anything from cities (e.g. “palo alto”, “Palo Alto, CA”), states (e.g. “CA, USA”, “California”, “cali”), regions (e.g. “NorCal”, “west coast”), countries (e.g. “USA”, “U.S.”, “america”), or abstract concepts meant to be jokes (e.g. “none of your business”). Researchers have leveraged the location fields on Bluelight and drugs-forum user profiles to geolocate subsets of their data to the county- (68) or country-level (22).
Some other platforms contain similar location fields, though these are less frequently populated than on forums. Schwartz et al. processed these optional location entries on X to create the County Tweet Lexical Bank, a dataset of tweets geolocated at the county level. (69) Several groups have leveraged the County Tweet Lexical Bank and datasets assembled by similar methods for opioid-related (8,9,42,70,71) and non-opioid-related (72,73) work. Similarly, other groups have used named entity recognition to extract unambiguous place names within social media text content.(74–77)
A simpler method of acquiring social media content associated with a geolocation is to search for content containing location-related keywords. Several groups have used the hashtag search functionality on TikTok to obtain content relevant to geographic regions (e.g. specific countries). (78,79) Similarly, Hu and Conway pulled text from country-specific subreddits as a proxy for geolocation (80); Delbruel et al. examined the association between YouTube video tags and geolocation (81); and Goyer et al. used keyword search to identify Reddit and X posts relevant to Canada and manually identified Canadian Facebook groups from which to extract content (82).
A key feature of social networks is that users are connected (through “friendship”, “following”, etc.) to other users with whom they often share some characteristics or interests in common; this means that sometimes we can infer the location of a user based on the locations of users to whom they are connected. For example, someone who almost exclusively follows people based in New York City on Instagram is likely to also be based in New York City. This line of reasoning has been used extensively for X (83–85)because it depends upon the social network being partially labeled with geolocation.
Examining a social media platform user’s posts beyond the topic of interest and profile information beyond an explicitly stated location can also yield a proxy for geolocation. This strategy is often used for Reddit as it is facilitated by explicit subforum (subreddit) topics and post titles, key features of this platform. Several groups have used the assumption that if a Reddit user frequently posts in a city-specific subreddit, then they are likely to live or spend a significant amount of time in that city (e.g. posting frequently in r/sanfrancisco implies living in San Francisco) (2,86,87). Researchers have also searched for posts with the topic of “where are you from?” or instances of the phrase “I live in…” (87,87) and leveraged user “flairs” (tags with small icons that Reddit users can add to their username) (87) to geolocate Reddit users.
Numerous packages and services for predicting geolocation from social media data exist. Free packages used previously for geolocating social media text (7,88) include Carmen (89) and geopy (90); paid services used previously for geolocating social media text (91–93) include Iconosquare (94), Brandwatch (formerly Crimson Hexagon) (95), and Reputation (formerly Nuvi) (96). Beyond these resources, many other groups have created various geolocation inference methods (48,97–100). While these methods can facilitate efficient geotagging of social media data and circumvent the need to create a new geolocation pipeline from scratch, it is important to note that the accuracy of such methods decreases with the passage of time (101).
When all else fails for a given platform, a final strategy to obtain geolocation estimates is to link users to accounts on a different platform that does have geolocation. For example, while Tumblr does not provide any geolocation information, Tumblr users can opt to share their posts to X. Xu et al. leveraged this cross-posting to obtain geolocation information for a subset of Tumblr users (77,102).
We summarize viable geolocation inference strategies for each of the shortlisted platforms in the “Example of geolocation inference strategy” column of Table 1.
Prior use in research literature
There is wide variation in the presence of each of our 11 shortlisted platforms in the existing literature on text-based analysis of the opioid epidemic. Of all shortlisted social media platforms, X (formerly Twitter) and Reddit were by far the most commonly used in existing literature. The topics of studies using these two platforms range from correlating opioid-related discussion volume and opioid-related overdose death rates (2,7–10,41,42,70,71), characterizing trends and themes in online discussion of OUD and OUD treatment (4,27,37–40,70,74,87,103–121), and characterizing public sentiment towards the opioid epidemic generally (39,82,93,108,122,123). Many research groups have also created models to automatically identify posts on X and Reddit with discussion related to opioids.(42,43,109,124–127) Others have used these platforms to characterize factors that influence opioid use, recovery, and the opioid epidemic generally (6,8,128–132), with particular interest shown to the impact of the COVID-19 pandemic (103,120,133–139) and co-use between opioids and other drugs (140,141).
The platforms with the next most volume of prior work were Instagram and Facebook. Researchers used these data to examine various aspects of opioid use (142–144), to characterize content related to drug sales (16,145–147), to identify emerging psychoactive substances (121), and to study public awareness of and reactions to the opioid epidemic generally (82,148,149). Though Instagram is an image-focused platform, nearly all studies primarily used text from captions and comments as the basis of their analysis. Facebook text data was largely obtained from public groups and pages.
YouTube, Tumblr, and drugs-forum.com all have seen modest usage in text-based research focused on the opioid epidemic. YouTube comments have been analyzed with NLP techniques to characterize general sentiments toward the opioid epidemic (150). YouTube and drugs-forum were both used in a study characterizing misinformation related to OUD medications (105). Researchers searched YouTube and Tumblr, among other platforms, for content about emerging psychoactive substances (121). Others have used Tumblr text data for detection of illicit opioid sales (16,151,152). Researchers have found correlations between trends in drugs-forum.com contents and NSDUH survey data (22). Drugs-forum.com has also been used for analysis of phenomena for other drugs (153,154).
We did not find any prior work using the remaining four shortlisted platforms (Pinterest, TikTok, Bluelight, and LinkedIn) for text-based analysis focused on the opioid epidemic. However, researchers have previously used Pinterest and TikTok to study portrayals of drugs other than opioids (155–162). Researchers have used Bluelight in the context of recruiting participants for studies related to opioid use (163,164). Our PubMed query returned no results related to opioid research for LinkedIn.
DISCUSSION
We found that all eleven shortlisted platforms contain notable volumes of opioid-related discussion. Beyond total volume of opioid-related content, other factors affecting utility in an opioid epidemic surveillance system include degree of censorship, user base demographics, and geolocatability. However, researchers must consider the accessibility and stability of these data sources before incorporating them in public health research or surveillance. While we highlight APIs and other data accession methods for shortlisted platforms, not all drug-related discussion or user metadata may be available through official APIs. Recently, some platforms have shifted from freely available APIs to paywalled versions, which may be cost-prohibitive for longitudinal large-scale projects. Quickly evolving trends in user language and norms may also require workflow updates to ensure that relevant discussions are being captured, as we show here with the emergence of algospeak. While we present all eleven shortlisted platforms as promising sources for future surveillance methods, we highlight TikTok, Facebook, and YouTube as underutilized platforms with significant opioid-related content.
Platform users, contents and dynamics affect research utility
Platforms that allow open discussion of drug-related topics (e.g. Bluelight, drugs-forum) or that grant pseudo-anonymity (e.g. X, Tumblr) afford greater freedom in discussing stigmatized topics. This increases the amount of opioid-related signal on a platform, as we observed when examining volume of opioid terms relative to common household terms. Conversely, platforms with high levels of moderation may spur increased algospeak usage. This phenomenon has been described in the literature with respect to TikTok (35,165,166), corroborating our finding of high levels of algospeak on the platform. It is therefore imperative that future work with TikTok or similar platforms accounts for opioid-related algospeak in order to fully capture relevant content.
When selecting platforms for a social media based surveillance system of the opioid epidemic, it is important to consider the demographics of each platform’s user base. For example, the user base for TikTok skews to younger age groups. In a Statista survey, 67% of respondents aged 18-19 and 56% of respondents aged 20-29 reported TikTok use, compared to 38% of 40-49 year olds (167). Individuals who initiate opioid use at a younger age are more susceptible to substance use disorders (168); monitoring discussions around opioid use in these age groups could help inform preventative programs that target young individuals. By contrast, Facebook skews slightly older, with 75% of 30-49 year olds reporting that they use the platforms as opposed to 67% of 18-29 year olds (169). Platform demographics also vary by gender. A greater proportion of women than men report using Facebook, Instagram, TikTok, and Pinterest, whereas a greater proportion of men than women report using X and Reddit. (169) Given the broad demographics of the opioid epidemic, a strategy of following multiple social media platforms in order to monitor all relevant demographics may be required.
Most prior work in social media pharmacovigilance has been conducted using X and Reddit. This is almost certainly because of their high volume of content (both in total and drug-related), their formerly freely accessible APIs, and their inferrable or explicitly-provided geolocation data. However, other platforms used less in research share these attributes. We have outlined geolocation inference strategies for all 11 shortlisted platforms. Facebook, YouTube, TikTok, and LinkedIn emerged as platforms with high total volumes of opioid-related discussion but relatively low prior use in the literature. According to Pew Research Center, Facebook and YouTube are the most-used online platforms by Americans as of January 2024 (169), and TikTok has emerged as a popular platform for youth. We found that LinkedIn’s high volume of opioid-related discussion was the result of people sharing research and educational resources related to opioids on the platform. At a minimum, these four platforms may provide insight supplementary to that from X and Reddit.
API access to social media data can be limited
It is not always possible to retrieve all data collected by a social media platform through its API. For example, many social media platforms infer geolocation and demographic information from user activity, but will typically omit such identifiers from available datasets. Additionally, some platforms limit the scope of posts that can be accessed and only allow queries from a small subsample of data rather than the full historical archive. Alternatives to APIs for obtaining data include manual search, web scraping of public webpages, or soliciting donation of private data directly from users, which have seen prior use (82,144,148,149,170) but these methods are more time intensive. We remind the reader that web scraping and third-party APIs may be against a platform’s terms of service and that researchers should always review the terms and conditions of data use provided by platforms of interest.
Notably, many platforms allow users to post private content that is not broadly viewable. Such private content cannot be obtained through APIs or web scraping. It is plausible that users discuss opioid use on social media among their private networks, but share fewer or more filtered accounts in the public sphere. If there are substantial differences in users that engage in public versus private discourse, data will be subject to selection biases and negatively impact downstream models. On platforms with largely pseudo-anonymous users (e.g. Reddit, Bluelight) or where “burner” accounts are common (e.g. X), private posts may be less prevalent, making the dataset more representative of the platform’s overall user base.
Changing business models affect platform availability and stability
The policies and practices of social media companies are rapidly evolving, leading to unstable data access from these platforms for research. Notably, we found that Reddit was one of the most commonly used platforms in prior research. This was likely mediated by the availability of Pushshift, a third-party tool that allowed researchers to easily access Reddit’s post archives. However, efforts to further monetize the primary Reddit API effectively disabled Pushshift and limited access to these data by researchers.
Data instability could pose a major challenge to deploying a reliable surveillance system for opioid overdoses or conducting longitudinal studies. Surveillance systems that rely on social media data should place safeguards for scenarios where updated data is unavailable. Incorporating other data sources, such as emergency room admissions or wastewater monitoring, could make systems more robust to gaps in data access. Projecting overdoses further into the future, at the cost of larger predictive error, could also prevent gaps in hotspot detection. For future research, it would be prudent to work directly with these companies to establish current regulatory policies and opportunities for data access.
Similarly, changes in how users interact with platforms may affect how overdose hotspots can be anticipated from social media data. Emerging slang or algospeak might not be reflected in a pre-trained model, and rising discussions with these terms would not translate to predicted increases in overdoses. An effective warning system would need to be regularly maintained to reflect digital trends.
Limitations
Our study is subject to limitations that are inherent to research that uses social media data. The extent to which platforms are willing to share data for research is constantly evolving. Privacy and intellectual property concerns have pushed platforms to take a more conservative stance with data sharing. We were not able to access the full text corpus of any platform, but were able to use Google search queries as a proxy measure of how much discussion actually takes place. In practice, platforms may only provide subsamples of their text data to researchers and not all data may be accessible for studies.
The selection of specific opioid-related terms is another limitation in how we quantify opioid-related discussion. There are many phrases that have dual meanings, so we attempted to select only terms that are used exclusively to refer to opioids to avoid the false detection of opioid-related discussion. Additionally, informal language is constantly evolving and the terms used here may not be in use in the future. Here, we detailed a procedure that used generative models to create a list of terms; we believe that these methods could be used to identify updated informal language around opioids at future points in time.
We used Google search queries as a proxy estimate of the overall volume of opioid-related discussion. However, these estimates may be influenced by how Google indexes web pages. Platforms owned by Google, such as Youtube, may be overrepresented in their search results. Other platforms may restrict the access to unregistered users, which inadvertently impacts how Google can process their webpages.(171) Similarly, Google search does not return private content that has been restricted by users. We hope that our estimates provide a crude estimate of how much opioid-related discussion is on each site, but we caution that the amount of data that can actually be accessed by researchers may vary.
We are aware that a key limitation of our analysis is its explicit focus on English text data on platforms primarily serving North America. Our choice to focus on North America was driven by the severity of the opioid addiction and overdose in the United States and Canada. However, OUD is a global problem and analysis beyond North America is needed. We chose to focus on English text and platforms with English content for our own ease of analysis as English-speaking researchers. But according to the U.S. Census Bureau, over 20% of Americans speak a language other than English at home (172), meaning that to fully characterize the opioid epidemic, text-based research must be done on other languages beyond just English. We encourage future research in leveraging social media platforms for pharmacovigilance of the opioid epidemic in regions other than North America and languages other than English for more equitable and complete assessment of this worldwide crisis.
CONCLUSION
Social media data signals correlate with trends in the ongoing opioid epidemic. Although existing research has already leveraged social media platforms to analyze such phenomena, most research has focused on only a few of the social media platforms currently in use. We have characterized the utility and accessibility of platforms with potential for monitoring opioid-related discussion to motivate future research and give a more complete perspective of emerging trends in the opioid epidemic.
Data Availability
All data and code produced are available online at https://github.com/kristycarp/opioid-social-media-platforms.
ACKNOWLEDGEMENTS
The authors would like to thank Salvatore Giorgi, Shashanka Subrahmanya, Aadesh Salecha, and Rhana Hashemi for insightful conversations and assistance. This work supported by: NIH DA057598; Microsoft Accelerating Foundation Models Research Initiative; NSF GRFP DGE-1656518 to KAC; NIH NHLBI T32HL151323 to ATN; DAS is supported by the Stanford Biochemistry Department and NSF GRFP 2019286895; Stanford Summer First Fellowship to IAS; Sarafan ChEM-H CBI Program Award to IAS; KH is supported by a Senior Research Career Scientist Award (RCS 04-141-3) from the Department of Veterans Affairs Health System Research Service; JCE, RBA, AL are supported by the Stanford Institute for Human-Centered AI; RBA is supported by the Chan Zuckerberg Biohub.
REFERENCES
- 1.↵
- 2.↵
- 3.↵
- 4.↵
- 5.↵
- 6.↵
- 7.↵
- 8.↵
- 9.↵
- 10.↵
- 11.↵
- 12.↵
- 13.↵
- 14.
- 15.↵
- 16.↵
- 17.↵
- 18.↵
- 19.
- 20.
- 21.
- 22.↵
- 23.
- 24.↵
- 25.↵
- 26.↵
- 27.↵
- 28.
- 29.
- 30.
- 31.↵
- 32.↵
- 33.↵
- 34.↵
- 35.↵
- 36.↵
- 37.↵
- 38.
- 39.↵
- 40.↵
- 41.↵
- 42.↵
- 43.↵
- 44.↵
- 45.↵
- 46.↵
- 47.↵
- 48.↵
- 49.↵
- 50.
- 51.
- 52.↵
- 53.↵
- 54.
- 55.↵
- 56.↵
- 57.↵
- 58.↵
- 59.↵
- 60.↵
- 61.↵
- 62.
- 63.↵
- 64.↵
- 65.↵
- 66.↵
- 67.↵
- 68.↵
- 69.↵
- 70.↵
- 71.↵
- 72.↵
- 73.↵
- 74.↵
- 75.
- 76.
- 77.↵
- 78.↵
- 79.↵
- 80.↵
- 81.↵
- 82.↵
- 83.↵
- 84.
- 85.↵
- 86.↵
- 87.↵
- 88.↵
- 89.↵
- 90.↵
- 91.↵
- 92.
- 93.↵
- 94.↵
- 95.↵
- 96.↵
- 97.↵
- 98.
- 99.
- 100.↵
- 101.↵
- 102.↵
- 103.↵
- 104.
- 105.↵
- 106.
- 107.
- 108.↵
- 109.↵
- 110.
- 111.
- 112.
- 113.
- 114.
- 115.
- 116.
- 117.
- 118.
- 119.
- 120.↵
- 121.↵
- 122.↵
- 123.↵
- 124.↵
- 125.
- 126.
- 127.↵
- 128.↵
- 129.
- 130.
- 131.
- 132.↵
- 133.↵
- 134.
- 135.
- 136.
- 137.
- 138.
- 139.↵
- 140.↵
- 141.↵
- 142.↵
- 143.
- 144.↵
- 145.↵
- 146.
- 147.↵
- 148.↵
- 149.↵
- 150.↵
- 151.↵
- 152.↵
- 153.↵
- 154.↵
- 155.↵
- 156.
- 157.
- 158.
- 159.
- 160.
- 161.
- 162.↵
- 163.↵
- 164.↵
- 165.↵
- 166.↵
- 167.↵
- 168.↵
- 169.↵
- 170.↵
- 171.↵
- 172.↵
- 173.
- 174.
- 175.
- 176.
- 177.
- 178.
- 179.
- 180.