Use electronic health record (EHR) data to (1) estimate the risk of arrhythmia associated with inhaled short-acting beta-2 agonists (SABA) in pediatric patients and (2) determine whether risk varied by on-label versus off-label prescribing. Retrospective cohort study of 335041 children ≤18years using EHR primary care data from 2 pediatric health systems (2011-2013). A series of monthly pseudotrials were created, using propensity score methodology to balance baseline characteristics between SABA-exposed (identified by prescription) and SABA-unexposed children. Association between SABA and subsequent arrhythmia for each health system was estimated through pooled logistic regression with separate estimates for children initiating under and over 4years old (off-label and on-label, respectively). Eleven percent of the cohort received a SABA prescription, 57% occurred under the age of 4years (off-label). During the follow-up period, there were 283 first arrhythmia events, most commonly atrial tachyarrhythmias and premature ventricular/atrial contractions. In 1 health system, adjusted risk for arrhythmia was increased among exposed children (OR 1.89, 95% CI 1.31-2.73) without evidence of interaction between label status and risk. The absolute adjusted rate difference was 3.6/10000 person-years of SABA exposure. The association between SABA exposure and arrhythmias was less strong in the second system (OR 1.26, 95% CI 0.30-5.33). Using EHR data, we could estimate the risk of a rare event associated with medication use and determine difference in risk related to on-label versus off-label status. These findings support the value of EHR-based data for postmarketing drug studies in the pediatric population.