Background: Despite the fact that medication is taken during more than 90% of pregnancies, the fetal risk for most medications is unknown, and the majority of medications have no data regarding safety in pregnancy.
Objective: Using β-blockers as a proof-of-concept, the primary objective of this study was to assess the utility of Twitter data for a cohort study design—in particular, whether we could identify (1) Twitter users who have posted tweets reporting that they took medication during pregnancy and (2) their associated pregnancy outcomes.
Methods: We searched for mentions of β-blockers in 2.75 billion tweets posted by 415,690 users who announced their pregnancy on Twitter. We manually reviewed the matching tweets to first determine if the user actually took the β-blocker mentioned in the tweet. Then, to help determine if the β-blocker was taken during pregnancy, we used the time stamp of the tweet reporting intake and drew upon an automated natural language processing (NLP) tool that estimates the date of the user’s prenatal time period. For users who posted tweets indicating that they took or may have taken the β-blocker during pregnancy, we drew upon additional NLP tools to help identify tweets that report their pregnancy outcomes. Adverse pregnancy outcomes included miscarriage, stillbirth, birth defects, preterm birth (<37 weeks gestation), low birth weight (<5 pounds and 8 ounces at delivery), and neonatal intensive care unit (NICU) admission. Normal pregnancy outcomes included gestational age ≥37 weeks and birth weight ≥5 pounds and 8 ounces.
Results: We retrieved 5114 tweets, posted by 2339 users, that mention a β-blocker, and manually identified 2332 (45.6%) tweets, posted by 1195 (51.1%) of the users, that self-report taking the β-blocker. We were able to estimate the date of the prenatal time period for 356 pregnancies among 334 (27.9%) of these 1195 users. Among these 356 pregnancies, we identified 257 (72.2%) during which the β-blocker was or may have been taken. We manually verified an adverse pregnancy outcome—preterm birth, NICU admission, low birth weight, birth defects, or miscarriage—for 38 (14.8%) of these 257 pregnancies. We manually verified a gestational age ≥37 weeks for 198 (90.4%) and a birth weight ≥5 pounds and 8 ounces for 50 (22.8%) of the 219 pregnancies for which we did not identify an adverse pregnancy outcome.
Conclusions: Our ability to detect pregnancy outcomes for Twitter users who posted tweets reporting that they took or may have taken a β-blocker during pregnancy suggests that Twitter can be a complementary resource for cohort studies of drug safety in pregnancy.
Prescription or over-the-counter medication is taken during more than 90% of pregnancies . Despite the widespread use of medication during pregnancy, the fetal risk for most medications approved by the US Food and Drug Administration is unknown, and the majority of approved medications have no data regarding safety in pregnancy [ ]. Given that Twitter has become a popular source of data on health conditions [ ], it should be explored for evaluating drug safety in pregnancy, especially since 42% of people aged 18-29 years and 27% of people aged 30-49 years in the United States use Twitter [ ]. Our prior work [ ] used Twitter data in a case-control study that involved identifying users who reported a birth defect outcome (cases) [ ] and users who did not (controls), and then searching their tweets for reports of medication exposure during pregnancy. Twitter data has not been assessed, however, for its utility in a cohort study design, which would involve identifying pregnancy outcomes for users who have reported taking medication during pregnancy.
Using β-blockers as a proof-of-concept, the primary objective of this study was to assess whether we could identify (1) Twitter users who have posted tweets reporting that they took medication during pregnancy and (2) their associated pregnancy outcomes, including miscarriage, stillbirth, birth defects, preterm birth (<37 weeks gestation), low birth weight (<5 pounds and 8 ounces at delivery), and neonatal intensive care unit (NICU) admission. We chose β-blockers as an example because cardiovascular disease is the leading cause of pregnancy-related deaths in the United States  and β-blockers are the most common type of medication for treating cardiac conditions during pregnancy [ ]. Meanwhile, data on the safety of maternal β-blocker exposure are inconsistent; some studies report associations with low birth weight, preterm birth, perinatal mortality, or birth defects [ - ], while others do not [ - ].
The Twitter data used in this study were collected and analyzed in accordance with the Twitter Terms of Service. The Institutional Review Board of the University of Pennsylvania reviewed this study and deemed it exempt human subjects research under 45 CFR §46.101(b)(4) for publicly available data sources (protocol# 828972). Although the tweets presented in this paper were public at the time of this study, we have slightly modified them, including removing usernames and URLs and redacting names, to help deidentify the users.
We searched for mentions of β-blockers and their lexical variants (eg, misspellings)  in 2.75 billion tweets posted by 415,690 users who announced their pregnancy on Twitter [ ]. provides the β-blocker keywords and their lexical variants. We used annotation guidelines [ ] to manually distinguish tweets reporting that the user actually took the β-blocker. If the tweet reported intake but did not explicitly indicate that the intake occurred during pregnancy, we used the time stamp of the tweet and drew upon an automated natural language processing (NLP) tool [ ] that estimates the date of the user’s prenatal time period. We also identified reports of taking a β-blocker that occurred before or after pregnancy, assuming that, if there was no evidence in the tweet that the user stopped taking it before pregnancy or started taking it after pregnancy, the user may have been taking it during pregnancy. We excluded users for whom we could not estimate the date of their prenatal time period.
|Atenolol||Atenelol, atenonol, atenanol, antenolol, atenol, atenolo, atenalol, antenenol, atentol, atenenol, attenalol, atenlol, attenolol, altenolol|
|Beta blocker||Beta-blocker, b blocker, b-blocker, beta blockers, beta-blockers,|
b blockers, b-blockers, betablocker, bblocker, betablockers, bblockers
|Metoprolol||Metopolol, metropolol, metorolol, metroprolol, metaprolol, metoporol, metprolol, metotoprolol, metropolo, metroplol, meteprolol, metoprol, metroporol, metoprolo|
|Propranolol||Propananol, propanonol, proprapanol, propranonol, proranolol, propanolol, propranalol, proprananol, propanalol, propronolol|
|Toprol||Toprol, toprolol, topral, toperol, tropol, toporal, toporol, toporolol|
aN/A: not applicable.
For users who posted tweets indicating that they took or may have taken the β-blocker during pregnancy, we drew upon automated NLP tools [, ] to help identify tweets that self-report an associated pregnancy outcome, including miscarriage, stillbirth, birth defects, preterm birth, low birth weight, and NICU admission. To assess a potential reporting bias, we drew upon an automated NLP tool [ ] that detects tweets reporting a gestational age ≥37 weeks (indicates the lack of miscarriage and preterm birth) or a birth weight ≥5 pounds and 8 ounces (indicates the lack of low birth weight, miscarriage, and stillbirth). If we did not automatically detect a tweet explicitly reporting a gestational age ≥37 weeks, we manually analyzed tweets posted during this time for evidence that the user was still pregnant.
Two important potential confounders when evaluating drug safety in pregnancy are maternal age and indication for use. To help identify maternal age, we deployed an automated NLP tool  that identifies tweets self-reporting the exact age of the user at the time the tweet was posted. Then, we used the date of the user’s prenatal time period to determine the user’s age during pregnancy. To identify an indication for use, we manually reviewed the tweets reporting intake of a β-blocker posted by users who took or may have taken the β-blocker during pregnancy.
Excluding retweets, we retrieved 5114 tweets, posted by 2339 users, that mention a β-blocker, and manually identified 2332 (45.6%) tweets, posted by 1195 (51.1%) of the users, that self-report taking the β-blocker. We were able to estimate the date of the prenatal time period for 334 (27.9%) of the 1195 users. Because some users’ collection of tweets span several years and include multiple pregnancies, we identified 356 pregnancies among these 334 users. Among these 356 pregnancies, we found evidence that a β-blocker was taken during 58 (16.3%) of them and may have been taken during 199 (55.9%) of them.presents examples of two users’ tweets. User 1 reported on January 25, 2020, that the baby’s due date was in 100 days, so our automated tool [ ] estimated that pregnancy began on July 29, 2019, and would end on May 4, 2020. On April 16, 2020, User 1 explicitly reported taking Propranolol during pregnancy. User 1 reported that the baby was born premature on April 2, 2020—between 35 and 36 weeks gestation—with a low birth weight of 4 pounds and 12 ounces, and was admitted to the NICU. User 2 reported being 37 weeks pregnant on June 1, 2020, so our automated tool [ ] estimated that pregnancy began on September 16, 2019, and would end on June 22, 2020. Whereas User 1 explicitly reported taking a β-blocker during pregnancy, for User 2, we used the time stamp of March 26, 2020, to infer that the intake was during pregnancy. User 2 reported on June 11, 2020, that the baby was born—between 38 and 39 weeks gestation—and weighed 7 pounds and 5 ounces at birth.
We manually verified an adverse pregnancy outcome—preterm birth, NICU admission, low birth weight, birth defects, or miscarriage—for 38 (14.8%) of the 257 pregnancies during which a β-blocker was or may have been taken.presents the adverse pregnancy outcomes among these 257 pregnancies. We manually verified a gestational age ≥37 weeks for 198 (90.4%) and a birth weight ≥5 pounds and 8 ounces for 50 (22.8%) of the 219 pregnancies for which we did not identify an adverse pregnancy outcome. We identified maternal age for 222 (86.4%) of the 257 pregnancies during which a β-blocker was or may have been taken. includes the mean age per adverse pregnancy outcome. We identified an indication for taking the β-blocker for 197 (76.7%) of these 257 pregnancies—for example, tachycardia, hypertension, anxiety, and migraines.
|User and tweet||Time stamp||Pregnancy start||Pregnancy end|
|exactly 100 days til my due date!||2020-01-25|
|I was on Propranolol during my pregnancy and I had the CRAZIEST dreams I swear||2020-04-16|
|Officially introducing [name], born April 2nd, 2020. 4lbs 12oz, 18”. She’s in NICU due to being premature, but she’s doing well!||2020-04-03|
|5yo called me fat after I told 2.5yo I was too large to fit between their seats because of the baby. #37weekspregnant||2020-06-01|
|I saw the MFM and cardiologist last week. It was determined my cardiomyopathy is manageable and I was put on a beta blocker||2020-03-26|
|Introducing [name] 7lbs 5oz 20” long Csection went really well. We can’t wait until the big boys get to meet him||2020-06-11|
|Pregnancy outcome||Number of users, (%)||Sample tweet||Mean age|
|Preterm birth||23 (8.9%)||[name] came at 35 weeks. My baby is small, even for a preemie.||29 (n=20)|
|Neonatal intensive care unit admission||12 (4.7%)||Our sweet girl has been in the NICU these past few days. She\'s doing better everyday and we\'re really hoping she gets to go home soon.||27 (n=10)|
|Low birth weight||9 (3.5%)||Officially introducing [name], born April 2nd, 2020 at 11:01am. 4lbs 12oz, 18 inches.||27 (n=9)|
|Birth defect||4 (1.6%)||My son was also born with Craniosynostosis (Sagittal). He’s now 4 and wears his ‘wiggly’ line with pride||27 (n=3)|
|Miscarriage||1 (0.4%)||One of the worst parts of #miscarriage is ur 1st period afterwards. It’s so definitive, so confirming that it’s over #babyloss||45 (n=1)|
|Compositeb||38 (14.8%)||N/A||28 (n=33)|
aN/A: not applicable.
bMultiple adverse pregnancy outcomes were identified for some pregnancies, so the number of composite adverse pregnancy outcomes is less than the sum of the individual adverse pregnancy outcomes.
Our ability to detect pregnancy outcomes for Twitter users who posted tweets reporting that they took or may have taken a β-blocker during pregnancy suggests more generally that Twitter could be a complementary resource for cohort studies of drug safety in pregnancy. Additionally, our ability to identify both the maternal age and indication for taking a β-blocker for many of the users demonstrates that Twitter data would even allow such studies to account for the effect of these two important potential confounders. This study suggests that Twitter data may be particularly valuable for assessing associations with preterm birth, given both the volume of its reports on Twitter and our finding that preterm birth is largely unaffected by a potential reporting bias; that is, we detected a gestational age ≥37 weeks for 198 (90.4%) of the 219 pregnancies for which we did not identify an adverse pregnancy outcome.
Low birth weight may be affected by a potential reporting bias, given that we detected a birth weight ≥5 pounds and 8 ounces for only 50 (22.8%) of these 219 pregnancies. Although the rate of miscarriage in the United States is upward of more than 20% , our detection of miscarriage may be limited by a selection bias if users tend to announce their pregnancy on Twitter at a gestational age after which miscarriage infrequently occurs. Given our initial sample of 257 users, it is not surprising that we did not detect any reports of stillbirth, which has an incidence of <1% in the United States [ ]. Nonetheless, our prior work [ ] demonstrates that users do report stillbirth outcomes on Twitter, and our identification of users announcing their pregnancy on Twitter continues to grow in real time [ ].
Given the widespread use of medication during pregnancy and the insufficient data on fetal risks, Twitter can be a complementary resource for cohort study designs.
The authors thank Ivan Flores for contributing to software applications, and Alexis Upshur for contributing to manually analyzing the Twitter data. This work was supported by the National Library of Medicine (R01LM011176).
AZK contributed to collecting the Twitter data, manually analyzing the Twitter data, and writing the manuscript. KO contributed to manually analyzing the Twitter data and editing the manuscript. LDL designed the study, including the selection of β-blockers, pregnancy outcomes, and inclusion/exclusion criteria, and edited the manuscript. GGH conceptualized the use of Twitter data for studying medication exposure in pregnancy, guided the study, and edited the manuscript.
Conflicts of Interest
- Mitchell AA, Gilboa SM, Werler MM, Kelley KE, Louik C, Hernández-Díaz S, National Birth Defects Prevention Study. Medication use during pregnancy, with particular focus on prescription drugs: 1976-2008. Am J Obstet Gynecol 2011 Jul;205(1):51.e1-51.e8 [FREE Full text] [CrossRef] [Medline]
- Adam MP, Polifka JE, Friedman J. Evolving knowledge of the teratogenicity of medications in human pregnancy. Am J Med Genet C Semin Med Genet 2011 Aug 15;157C(3):175-182. [CrossRef] [Medline]
- Mavragani A. Infodemiology and infoveillance: scoping review. J Med Internet Res 2020 Apr 28;22(4):e16206 [FREE Full text] [CrossRef] [Medline]
- Auxier B, Anderson M. Social media use in 2021. Pew Research Center. URL: https://www.pewresearch.org/internet/2021/04/07/social-media-use-in-2021/ [accessed 2021-08-02]
- Golder S, Chiuve S, Weissenbacher D, Klein A, O'Connor K, Bland M, et al. Pharmacoepidemiologic evaluation of birth defects from health-related postings in social media during pregnancy. Drug Saf 2019 Mar 3;42(3):389-400 [FREE Full text] [CrossRef] [Medline]
- Klein AZ, Sarker A, Cai H, Weissenbacher D, Gonzalez-Hernandez G. Social media mining for birth defects research: A rule-based, bootstrapping approach to collecting data for rare health-related events on Twitter. J Biomed Inform 2018 Nov;87:68-78 [FREE Full text] [CrossRef] [Medline]
- Petersen EE, Davis NL, Goodman D, Cox S, Mayes N, Johnston E, et al. Vital Signs: Pregnancy-Related Deaths, United States, 2011-2015, and Strategies for Prevention, 13 States, 2013-2017. MMWR Morb Mortal Wkly Rep 2019 May 10;68(18):423-429 [FREE Full text] [CrossRef] [Medline]
- Ruys TP, Maggioni A, Johnson MR, Sliwa K, Tavazzi L, Schwerzmann M, et al. Cardiac medication during pregnancy, data from the ROPAC. Int J Cardiol 2014 Nov 15;177(1):124-128. [CrossRef] [Medline]
- Lydakis C, Lip G, Beevers M, Beevers D. Atenolol and fetal growth in pregnancies complicated by hypertension. Am J Hypertens 1999 Jun;12(6):541-547. [CrossRef] [Medline]
- Magee L, Duley L. Oral beta-blockers for mild to moderate hypertension during pregnancy. Cochrane Database Syst Rev 2003(3):CD002863. [CrossRef] [Medline]
- Nakhai-Pour HR, Rey E, Bérard A. Antihypertensive medication use during pregnancy and the risk of major congenital malformations or small-for-gestational-age newborns. Birth Defects Res B Dev Reprod Toxicol 2010 Apr 31;89(2):147-154. [CrossRef] [Medline]
- Meidahl Petersen K, Jimenez-Solem E, Andersen JT, Petersen M, Brødbæk K, Køber L, et al. β-Blocker treatment during pregnancy and adverse pregnancy outcomes: a nationwide population-based cohort study. BMJ Open 2012 Jul 19;2(4):e001185 [FREE Full text] [CrossRef] [Medline]
- Yakoob MY, Bateman BT, Ho E, Hernandez-Diaz S, Franklin JM, Goodman JE, et al. The risk of congenital malformations associated with exposure to β-blockers early in pregnancy: a meta-analysis. Hypertension 2013 Aug;62(2):375-381 [FREE Full text] [CrossRef] [Medline]
- Ersbøll AS, Hedegaard M, Søndergaard L, Ersbøll M, Johansen M. Treatment with oral beta-blockers during pregnancy complicated by maternal heart disease increases the risk of fetal growth restriction. BJOG 2014 Apr 09;121(5):618-626. [CrossRef] [Medline]
- Xie R, Guo Y, Krewski D, Mattison D, Walker M, Nerenberg K, et al. Beta-blockers increase the risk of being born small for gestational age or of being institutionalised during infancy. BJOG 2014 Aug 17;121(9):1090-1096. [CrossRef] [Medline]
- Tanaka K, Tanaka H, Kamiya C, Katsuragi S, Sawada M, Tsuritani M, et al. Beta-blockers and fetal growth restriction in pregnant women with cardiovascular disease. Circ J 2016;80(10):2221-2226. [CrossRef]
- Duan L, Ng A, Chen W, Spencer HT, Lee M. Beta-blocker subtypes and risk of low birth weight in newborns. J Clin Hypertens (Greenwich) 2018 Nov 28;20(11):1603-1609 [FREE Full text] [CrossRef] [Medline]
- Magee LA, Ornstein MP, von Dadelszen P. Fortnightly review: management of hypertension in pregnancy. BMJ 1999 May 15;318(7194):1332-1336 [FREE Full text] [CrossRef] [Medline]
- Davis RL, Eastman D, McPhillips H, Raebel MA, Andrade SE, Smith D, et al. Risks of congenital malformations and perinatal events among infants exposed to calcium channel and beta-blockers during pregnancy. Pharmacoepidemiol Drug Saf 2011 Feb 15;20(2):138-145 [FREE Full text] [CrossRef] [Medline]
- Duan L, Ng A, Chen W, Spencer HT, Nguyen J, Shen AY, et al. β-Blocker Exposure in Pregnancy and Risk of Fetal Cardiac Anomalies. JAMA Intern Med 2017 Jun 01;177(6):885-887 [FREE Full text] [CrossRef] [Medline]
- Bergman JEH, Lutke LR, Gans ROB, Addor M, Barisic I, Cavero-Carbonell C, et al. Beta-Blocker Use in Pregnancy and Risk of Specific Congenital Anomalies: A European Case-Malformed Control Study. Drug Saf 2018 Apr 11;41(4):415-427 [FREE Full text] [CrossRef] [Medline]
- Abalos E, Duley L, Steyn D, Gialdini C. Antihypertensive drug therapy for mild to moderate hypertension during pregnancy. Cochrane Database Syst Rev 2018 Oct 01;10:CD002252 [FREE Full text] [CrossRef] [Medline]
- Bateman BT, Heide-Jørgensen U, Einarsdóttir K, Engeland A, Furu K, Gissler M, et al. β-blocker use in pregnancy and the risk for congenital malformations: an international cohort study. Ann Intern Med 2018 Nov 20;169(10):665-673 [FREE Full text] [CrossRef] [Medline]
- Wu Y, Yao J, Xu L, Chen M, Wan L. Risk of congenital malformations in offspring of women using β-blockers during early pregnancy: An updated meta-analysis of observational studies. Br J Clin Pharmacol 2021 Mar 27;87(3):806-815 [FREE Full text] [CrossRef] [Medline]
- Sarker A, Gonzalez-Hernandez G. An unsupervised and customizable misspelling generator for mining noisy health-related text sources. J Biomed Inform 2018 Dec;88:98-107 [FREE Full text] [CrossRef] [Medline]
- Sarker A, Chandrashekar P, Magge A, Cai H, Klein A, Gonzalez G. Discovering cohorts of pregnant women from social media for safety surveillance and analysis. J Med Internet Res 2017 Oct 30;19(10):e361 [FREE Full text] [CrossRef] [Medline]
- Klein A, Sarker A, Rouhizadeh M, O'Connor K, Gonzalez G. Detecting personal medication intake in Twitter: an annotated corpus and baseline classification system. In: Proceedings of the BioNLP 2017 Workshop. 2017 Presented at: BioNLP 2017; August 2017; Vancouver, Canada p. 136-142. [CrossRef]
- Rouhizadeh M, Magge A, Klein A, Sarker A, Gonzalez G. A rule-based approach to determining pregnancy timeframe from contextual social media postings. In: DH '18: Proceedings of the 2018 International Conference on Digital Health. 2018 Presented at: Proceedings of the International Conference on Digital Health; April 2018; Lyon, France p. 23-26. [CrossRef]
- Klein AZ, Sarker A, Weissenbacher D, Gonzalez-Hernandez G. Towards scaling Twitter for digital epidemiology of birth defects. NPJ Digit Med 2019 Oct 01;2(1):96 [FREE Full text] [CrossRef] [Medline]
- Klein AZ, Cai H, Weissenbacher D, Levine LD, Gonzalez-Hernandez G. A natural language processing pipeline to advance the use of Twitter data for digital epidemiology of adverse pregnancy outcomes. J Biomed Inform 2020;112S:100076 [FREE Full text] [CrossRef] [Medline]
- Klein AZ, Gebreyesus A, Gonzalez-Hernandez G. Automatically identifying comparator groups on Twitter for digital epidemiology of pregnancy outcomes. AMIA Jt Summits Transl Sci Proc 2020;2020:317-325 [FREE Full text] [Medline]
- Klein AZ, Magge A, Gonzalez-Hernandez G. ReportAGE: Automatically extracting the exact age of Twitter users based on self-reports in tweets. PLoS One 2022 Jan 25;17(1):e0262087 [FREE Full text] [CrossRef] [Medline]
- Ammon Avalos L, Galindo C, Li D. A systematic review to calculate background miscarriage rates using life table analysis. Birth Defects Res A Clin Mol Teratol 2012 Jun 18;94(6):417-423. [CrossRef] [Medline]
- Hoyert D, Gregory E. Cause-of-death data from the fetal death file, 2015-2017. Natl Vital Stat Rep 2020 Apr;69(4):1-20 [FREE Full text] [Medline]
|NICU: neonatal intensive care unit|
|NLP: natural language processing|
Edited by A Mavragani; submitted 24.01.22; peer-reviewed by S Matsuda, V Foufi, M Beazely; comments to author 17.03.22; revised version received 27.04.22; accepted 06.06.22; published 30.06.22Copyright
©Ari Z Klein, Karen O'Connor, Lisa D Levine, Graciela Gonzalez-Hernandez. Originally published in JMIR Formative Research (https://formative.jmir.org), 30.06.2022.
This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Formative Research, is properly cited. The complete bibliographic information, a link to the original publication on https://formative.jmir.org, as well as this copyright and license information must be included.