How-to articleMethodology & analyticsMedicine & healthcare

Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023

Social media posts can show how people talk about symptoms, treatments and public health messages, but the easy, free data access of the 2010s has gone. This guide explains what social media data can and cannot tell a health researcher, how access works now, and how to design, justify and report a doctoral study that uses it ethically.

What you will learn

  • Explain the main ways health researchers have used Twitter and other social media data
  • Describe how platform data access changed after 2023 and what that means for a doctoral timeline
  • Choose a defensible data source and sampling strategy for a social media health study
  • Evaluate validity threats such as unrepresentative users, bots and models that do not generalise
  • Apply current internet research ethics guidance to public posts
  • Report a social media study so that others can judge and repeat it

What you will unlearn

  • Researchers can download almost all tweets for free.Free and academic API access to X ended in 2023, so data access must now be planned, costed and justified like any other resource.
  • Public posts can be used without any ethical review.Users often do not expect research use of their posts, and health data are sensitive, so most universities expect ethics review and protective handling.
  • Social media users represent the general population.Platform users differ systematically from the population by age, country, interests and activity, and a few accounts produce most posts.
  • A classifier that works on one dataset will work on another.Mental health models trained on social media data often perform poorly when moved to new users, platforms or time periods.

Skills you will practise

  • Planning data access
  • Sampling social media data
  • Validity checking
  • Internet research ethics
  • Data minimisation and pseudonymisation
  • Transparent reporting

Why health researchers turned to Twitter

Social media gives health researchers something surveys rarely can: large volumes of unprompted talk, time-stamped as events happen. People describe symptoms, share experiences of care, react to public health campaigns and pass on misinformation, often in public. Hawn (2009) described early on how Twitter, Facebook and other platforms were starting to reshape communication in health care, and Alshaikh et al. (2014) reviewed how social network sites were being used as a way to collect health data.

During the 2010s Twitter became the platform most used in this work. Posts were short and similar in length, which suited text classification; the data were time-stamped, which suited time-series and surveillance; follower links allowed network analysis; and, crucially, an application programming interface (API) let researchers collect large samples cheaply. Sinnenberg et al. (2017) systematically reviewed this literature and grouped the studies by how they used the platform. Their categories are still a useful map of the field and are summarised in the table below.

Ways health researchers have used Twitter, after the categories in Sinnenberg et al. (2017)
UseWhat the researcher doesTypical doctoral question
Content analysisCodes what people post about a health topicHow do patients describe side effects of a new treatment?
Sentiment analysisClassifies posts as positive, negative or neutralHow did attitudes to a vaccine change after a policy announcement?
SurveillanceTracks the volume of posts as a signal of eventsDo symptom mentions rise before official influenza reports?
PredictionBuilds models from posting behaviourCan language features predict later reported distress? (high ethical risk)
EngagementMeasures responses to health messagesWhich campaign messages are shared and by whom?
Network analysisMaps who connects to whomHow does misinformation spread between communities?
RecruitmentUses the platform to reach participantsCan a hard-to-reach group be recruited for a survey or interview study?
InterventionDelivers a health intervention through the platformDoes a support account change behaviour?

Recruitment deserves separate mention because it is different in kind: the platform is used to reach people who then take part in a conventional study. Fenner et al. (2012) explored recruitment of young women for a health study through a social networking site, an approach many doctoral projects still use. The usual cautions about online samples then apply, and the survey itself should be reported with a checklist such as CHERRIES (Eysenbach, 2004).

What changed after 2023

That is no longer true. In 2023 Twitter, renamed X in July of that year, ended free API access and closed the Academic Research access route that many doctoral projects relied on; access now comes through paid tiers whose terms change and whose costs can be beyond a typical research budget. Other platforms tightened access in the same period: Reddit restricted its API in 2023, which also affected third-party archives built on it, and Meta closed CrowdTangle in August 2024. In the European Union, the Digital Services Act created a route for vetted researchers to request data from very large platforms for research on systemic risks, but it is a formal application process, not an open feed.

For a doctoral researcher this has three consequences. First, data access is now a feasibility risk that belongs in the proposal and the risk register, with a fallback. Second, studies built on older archived datasets must check whether the licence still allows use and sharing. Third, the choice of platform should follow the research question and the population, not habit: the people a health study needs to hear from may now be on other platforms entirely.

Routes to social media data for a doctoral health study
Access routeStrengthsLimits to plan for
Paid platform APICurrent data; structured fieldsCost; changing terms; rate limits; licence may forbid sharing
Regulated researcher access (e.g. EU Digital Services Act)Formal, potentially richer dataEligibility rules, application time, scope limited to approved questions
Existing archived datasetsCheap; may cover past eventsLicence status; deleted posts; unknown sampling
Open or decentralised platformsMore open interfaces on some servicesDifferent, often smaller user populations
Data donation or consented collectionConsent and context are built inSmaller samples; recruitment effort
Manual collection of a small sampleFeasible for qualitative workLabour; must respect platform terms

Validity: what social media data can and cannot show

Social media data are found data: they were produced for other purposes, by people who chose to post, on a platform whose design shapes what is said. Three threats matter most in health research.

  • Who is speaking. Platform users are not a sample of any general population, and a small number of accounts, including organisations and automated accounts, produce a large share of posts. Findings describe posts, not people, unless the design links the two.
  • What the words mean. Mentions of a condition may be jokes, news, marketing or self-disclosure. Keyword searches need validation against a hand-coded sample, with agreement statistics reported.
  • Whether models generalise. Reviews of mental health prediction from social media found weak construct validity, unclear ground truth and little external validation (Chancellor & De Choudhury, 2020; Guntuku et al., 2017). Ernala et al. (2019) showed that proxy diagnostic signals inferred from posts did not match clinically confirmed diagnoses well, and Harrigian et al. (2020) found that models often performed poorly when applied to new datasets.

Sinnenberg and colleagues also noted the absence of standard procedures and the questions of validity, reliability and scalability that remain open (Sinnenberg et al., 2017). A doctoral design answers these questions explicitly rather than leaving them to the limitations section. For a critical look at one social media mental health study, see Sentiment analysis and doctoral mental health; for conventional primary data in medical doctorates, see Collecting primary data for a medical PhD in the UK.

Ethics: public is not the same as fair game

That a post is publicly visible does not settle the ethical questions. In a survey of Twitter users, Fiesler and Proferes (2018) found that many were unaware their posts could be used in research and that their comfort depended on context, such as who the researchers were and whether the posts would be quoted. Health topics raise the stakes, because a quoted post can usually be traced back to its author by a simple search.

The Association of Internet Researchers guidelines ask researchers to weigh expectations of privacy, vulnerability of the people involved and potential harm, rather than applying a single rule (franzke et al., 2020). For health research specifically, Benton et al. (2017) recommend ethics review even where it might not be strictly required, collecting only the data needed, separating identifiers from content, avoiding verbatim quotation of sensitive posts and being cautious about linking accounts to other data. In the UK and EU, posts about health are special category personal data under data protection law, so a lawful basis, data minimisation and secure storage must be documented.

Designing the study: a step-by-step plan

  1. Start from the question. Decide whether you need what people say (content), how much they say it (volume), who talks to whom (networks) or access to people (recruitment). Each implies different data.
  2. Choose the platform for the population. Justify the platform by who uses it and how they discuss the topic, not by which data are easiest to obtain.
  3. Secure access early. Confirm the route, cost, terms and whether you may keep and share the data, and agree a fallback with your supervisor.
  4. Define the sample. Specify search terms, languages, dates and exclusions; test the terms on a pilot sample and report precision.
  5. Validate measurement. Hand-code a random subset with two coders, report agreement, and compare any automated classifier with the hand-coded labels.
  6. Handle bots and organisations. Decide in advance how you will identify and treat automated and institutional accounts.
  7. Protect people. Obtain ethics approval, pseudonymise, store data securely and paraphrase rather than quote sensitive posts.
  8. Interpret within limits. Describe findings as patterns in posts on one platform at one time, not as population prevalence.

Worked example (illustrative)

An illustrative case: a doctoral researcher in public health wants to understand how people describe side effects after starting a new class of weight-loss medicine. Her first plan, to collect all posts mentioning the drug names from X for two years, fails the feasibility test: the paid access tier needed is beyond her budget, and the licence would not let her share the data with her examiners.

She revises the design. The research question becomes "What side effects and coping strategies do users describe, and how do they talk about stopping treatment?", a content analysis question that does not need millions of posts. She samples posts from two public patient forums whose terms permit research use, stratified by month, and hand-codes 1,200 posts with a second coder on a 20% subset. She excludes commercial accounts, paraphrases every example she reports, and states that her findings describe forum posts, not the experience of all patients. A short follow-on survey, recruited through the forums and reported with CHERRIES (Eysenbach, 2004), lets consenting participants add context. The design is smaller than her first plan, but it is feasible, ethical and defensible at the viva.

What to report

Reporting checklist for a social media health study
ItemWhat to state
Platform and access routePlatform, interface or dataset used, dates of collection, licence terms
SamplingSearch terms, languages, date range, filters, exclusions and the number of posts at each step
AccountsHow bots, organisations and duplicate accounts were identified and handled
MeasurementCoding scheme, coder training, agreement statistics, classifier validation
Ethics and data protectionApproval, lawful basis, pseudonymisation, storage, quotation policy
GeneralisabilityWho the data can and cannot speak for; time period and platform limits
SharingWhat can be shared (IDs, code, codebook) under the platform terms

Common mistakes

  • Writing a proposal that assumes free API access without confirming cost and licence.
  • Treating counts of posts as prevalence of a condition in the population.
  • Using keyword matches without checking how many matched posts are actually about the topic.
  • Reporting an accurate classifier without testing it on data from a different time or platform.
  • Quoting sensitive health posts verbatim, so that authors can be found by a search.
  • Ignoring bots, news outlets and organisational accounts in a study of public opinion.

Key takeaways

  • Health researchers have used Twitter for content, sentiment, surveillance, engagement, network, recruitment and intervention studies (Sinnenberg et al., 2017).
  • Free and academic access to X data ended in 2023, so data access is now a feasibility question for the proposal.
  • Social media data describe posts by platform users, not populations, and models built on them often fail to generalise (Harrigian et al., 2020; Chancellor & De Choudhury, 2020).
  • Public posts still raise ethical questions; users often do not expect research use (Fiesler & Proferes, 2018), and health data need protective handling (Benton et al., 2017; franzke et al., 2020).
  • A defensible study states its access route, sampling, validation, ethics and limits in full.
Your next step

Want to apply this to your own study?

  1. 1Tell us your topic, data and deadline
  2. 2A subject mentor reviews your work with you
  3. 3You get a plan and a quote
Primary data collection

References

  1. Alshaikh, F., Ramzan, F., Rawaf, S., & Majeed, A. (2014). Social network sites as a mode to collect health data: A systematic review. Journal of Medical Internet Research, 16(7), e171. https://doi.org/10.2196/jmir.3050
  2. Benton, A., Coppersmith, G., & Dredze, M. (2017). Ethical research protocols for social media health research. In Proceedings of the First ACL Workshop on Ethics in Natural Language Processing (pp. 94-102). Association for Computational Linguistics. https://doi.org/10.18653/v1/W17-1612
  3. Chancellor, S., & De Choudhury, M. (2020). Methods in predictive techniques for mental health status on social media: A critical review. npj Digital Medicine, 3, Article 43. https://doi.org/10.1038/s41746-020-0233-7
  4. Ernala, S. K., Birnbaum, M. L., Candan, K. A., Rizvi, A. F., Sterling, W. A., Kane, J. M., & De Choudhury, M. (2019). Methodological gaps in predicting mental health states from social media: Triangulating diagnostic signals. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems (pp. 1-16). ACM. https://doi.org/10.1145/3290605.3300364
  5. Eysenbach, G. (2004). Improving the quality of web surveys: The Checklist for Reporting Results of Internet E-Surveys (CHERRIES). Journal of Medical Internet Research, 6(3), e34. https://doi.org/10.2196/jmir.6.3.e34
  6. Fenner, Y., Garland, S. M., Moore, E. E., Jayasinghe, Y., Fletcher, A., Tabrizi, S. N., Gunasekaran, B., & Wark, J. D. (2012). Web-based recruiting for health research using a social networking site: An exploratory study. Journal of Medical Internet Research, 14(1), e20. https://doi.org/10.2196/jmir.1978
  7. Fiesler, C., & Proferes, N. (2018). "Participant" perceptions of Twitter research ethics. Social Media + Society, 4(1). https://doi.org/10.1177/2056305118763366
  8. franzke, a. s., Bechmann, A., Zimmer, M., Ess, C., & the Association of Internet Researchers. (2020). Internet research: Ethical guidelines 3.0. Association of Internet Researchers. https://aoir.org/reports/ethics3.pdf
  9. Guntuku, S. C., Yaden, D. B., Kern, M. L., Ungar, L. H., & Eichstaedt, J. C. (2017). Detecting depression and mental illness on social media: An integrative review. Current Opinion in Behavioral Sciences, 18, 43-49. https://doi.org/10.1016/j.cobeha.2017.07.005
  10. Harrigian, K., Aguirre, C., & Dredze, M. (2020). Do models of mental health based on social media data generalize? In Findings of the Association for Computational Linguistics: EMNLP 2020 (pp. 3774-3788). Association for Computational Linguistics. https://doi.org/10.18653/v1/2020.findings-emnlp.337
  11. Hawn, C. (2009). Take two aspirin and tweet me in the morning: How Twitter, Facebook, and other social media are reshaping health care. Health Affairs, 28(2), 361–368. https://doi.org/10.1377/hlthaff.28.2.361
  12. Sinnenberg, L., Buttenheim, A. M., Padrez, K., Mancheno, C., Ungar, L., & Merchant, R. M. (2017). Twitter as a tool for health research: A systematic review. American Journal of Public Health, 107(1), e1–e8. https://doi.org/10.2105/AJPH.2016.303512

How to cite this article

Choose your referencing style, then copy. Check your university's or journal's guide for local variations.

PhD Research Lab Academy. (2020, July 6). Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023. PhD Research Lab. https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research/

PhD Research Lab Academy. “Using X (Twitter) and Other Social Media Data in PhD Health Research: Access, Methods and Ethics After 2023.” PhD Research Lab, 6 July 2020, www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research. Accessed [access date].

PhD Research Lab Academy (2020) Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023. PhD Research Lab. Available at: https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research/ (Accessed: [access date]).

PhD Research Lab Academy. “Using X (Twitter) and Other Social Media Data in PhD Health Research: Access, Methods and Ethics After 2023.” PhD Research Lab. July 6, 2020. https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research.

PhD Research Lab Academy, ‘Using X (Twitter) and Other Social Media Data in PhD Health Research: Access, Methods and Ethics After 2023’ (PhD Research Lab, 6 July 2020) <https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research> accessed [access date].

PhD Research Lab Academy. Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023 [Internet]. PhD Research Lab; 2020 Jul 6 [cited [access date]]. Available from: https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research/

PhD Research Lab Academy, “Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023,” PhD Research Lab, July 6, 2020. [Online]. Available: https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research. [Accessed: [access date]].

@online{how_you_can_use_twitter_as_a_tool_for_phd_health_research_2020,
  author = {{PhD Research Lab Academy}},
  title = {{Using X (Twitter) and other social media data in PhD health research: access, methods and ethics after 2023}},
  organization = {PhD Research Lab},
  date = {2020-07-06},
  url = {https://www.phdassistance.com/blog/how-you-can-use-twitter-as-a-tool-for-phd-health-research},
  urldate = {[access date]}
}

This article is for learning. Use it to understand the method and cite the original sources above in your own work; do not copy or submit it as your own.

Using X (Twitter) and other social media data in PhD health researchNeed help applying it to your study?
Primary data collection