Background and study aims Injectable glucagon enables easier biliary cannulation by inhibiting gastrointestinal motility and decreasing the frequency and amplitude of phasic activity of the sphincter of Oddi during endoscopic retrograde cholangiopancreatography (ERCP). Data about the safety profile of glucagon use and patient clinical outcomes are scarce. Patients and methods We used a federated cloud-based network research database, TriNetX, comprising 92 US healthcare organizations to find adult patients undergoing ERCP with glucagon use (Group A) vs. without using glucagon (Group B) from August 1, 2010, to August 1, 2021. The primary outcomes were rates of gastrointestinal bleeding, gastrointestinal perforation, post-ERCP pancreatitis, inpatient hospitalizations, and 30-day overall mortality measured after 1:1 propensity matching of the groups based on the baseline demographics and comorbidities. Results There were 9,008 patients in Group A compared to 256,597 in Group B. After matching, Group A patients had lower rates of gastrointestinal bleeding (risk ratio [RR], 0.68; CI, 0.52–0.86), post-ERCP pancreatitis (RR, 0.64; CI, 0.58–71), inpatient hospitalization (RR 0.34; CI:0.32 to 0.36) and overall mortality (RR, 0.81; CI, 0.66–0.99). The rates of gastrointestinal perforation (RR, 0.64; CI: 0.34 to 1.19), hyperkalemia (RR, 0.83; CI, 0.64–1.09) and hyperglycemia (RR, 0.65; CI, 0.41–1.03) did not differ between the two groups. Discussion Glucagon use during ERCP was associated with low rates of gastrointestinal bleeding, post-ERCP pancreatitis, inpatient hospitalization, and overall mortality. Moreover, the rates of hyperkalemia and hyperglycemia did not differ between the two groups even after matching for diabetes, indomethacin use, obesity, and chronic kidney disease.