Objective: Prior studies demonstrate that some untoward clinical outcomes vary by outdoor temperature. This is true of some endpoints common among persons with diabetes, a population vulnerable to climate change-associated health risks. Yet, prior work has been agnostic to the antidiabetes drugs taken by such persons. We examined whether relationships between ambient temperature and adverse health outcomes among persons with type 2 diabetes (T2D) varied by exposure to different antidiabetes drugs., Design: Retrospective cohort., Setting: Healthcare and meteorological data from five US states, 1999-2010., Participants: US Medicaid beneficiaries with T2D categorised by use of antidiabetes drugs., Exposure: Maximum daily ambient temperature (t-max)., Outcomes: Hospital presentation for serious hypoglycaemia, diabetic ketoacidosis (DKA) or sudden cardiac arrest (examined separately)., Methods: We linked US Medicaid to US Department of Commerce data that permitted us to follow individuals longitudinally and examine health plan enrolment, healthcare claims, and meteorological exposures-all at the person-day level. We mapped daily temperature from weather stations to Zone Improvement Plan (ZIP) codes, then assigned a t-max to each person-day based on the residential ZIP code. Among prespecified subcohorts of users of different pharmacologic classes of antidiabetes drugs, we calculated age and sex-adjusted occurrence rates for each outcome by t-max stratum. We used modified Poisson regression to assess relationships between linear and quadratic t-max terms and each outcome. We examined effect modification between t-max and a covariable for current exposure to a specific antidiabetes drug and assessed significance via Wald tests., Results: We identified ∼3 million persons with T2D among whom 713 464 used sulfonylureas (SUs), dipeptidyl peptidase-4 inhibitors (DPP-4is), meglitinides, or glucagon-like peptide 1 receptor agonists (GLP1RAs). We identified a positive linear association between t-max and serious hypoglycaemia among non-insulin users of glimepiride and of glyburide but not glipizide (Wald p value for interaction among SUs=0.048). We identified an inverse linear association between t-max and DKA among users of the DPP-4i sitagliptin (p=0.016) but not the GLP1RA exenatide (p=0.080). We did not identify associations between t-max and sudden cardiac arrest among users of SUs, meglitinides, exenatide, or DPP-4is., Conclusions: We identified some antidiabetes drug class-specific and agent-specific differences in the relationship between ambient temperature and untoward glycaemic but not arrhythmogenic, safety outcomes., Competing Interests: Competing interests: CEL is a Special Government Employee of the US Food and Drug Administration. CEL consults for Novo Nordisk and TriNetX. CEL recently received an honorarium from the American College of Clinical Pharmacy Foundation, University of Florida and Ancora Education. CEL’s spouse is employed by Merck; neither CEL nor his spouse own Merck stock. WB serves on multiple independent data monitoring committees for Genentech. MB has consulted for Clinique and ToxiMap. MB has received honoraria from the US Environmental Protection Agency, National Institutes of Health, Health Canada, Colorado School of Public Health, Duke University, University of Texas, Data4Justice, Korea University, Organization of Teratology Information Specialists, University of Pennsylvania, Boston University, IOP Publishing, Pacific-10 Conference, UK Research and Innovation, AXA Research Fund, Harvard University, SciQuest and University of Montana. MB has received travel support from the Colorado School of Public Health, University of Texas, Duke University, Boston University, University of Pennsylvania, Harvard University, American Journal of Public Health, Columbia University, CMAS conference and Nature conference. SH has consulted for the Medullary Thyroid Cancer Consortium (Novo Nordisk, AstraZeneca Pharmaceuticals LP, Eli Lilly and Company), Urovant Sciences, Bluebird Bio, Amylyx Pharmaceuticals, Ipsen Bioscience, Covis Pharma GmbH, i2o Therapeutics, Basilea, Balance Ophthalmics, Lykos Therapeutics and Applied Therapeutics. Other authors report no conflicts., (© Author(s) (or their employer(s)) 2024. Re-use permitted under CC BY-NC. No commercial re-use. See rights and permissions. Published by BMJ.)