BackgroundThe impact of time and state regulation on opioid prescribing in orthopedic trauma is not well known. The purpose of this study is to evaluate the impact of time and state-level opioid legislation on 90-day perioperative opioid prescribing in ankle fracture surgery from 2010 to 2019. MethodsThis is a retrospective, cohort study using a national insurance database including commercial insurance, Medicare, Medicaid, and cash pay patients to evaluate 30-day pre-operative to 90-day post-operative opioid prescription filling in 40,286 patients ages 18 and older undergoing Current Procedural Terminology codes 27,766, 27,769, 27,792, 27,814, 27,822, and/or 27,823 between 2010 and 2019 in all 50 United States. The primary study outcome was initial and cumulative perioperative opioid prescription filling and rates of filling and refills over the study timeframe. ResultsMean first prescription volume has not changed dramatically from 2010 (37 oxycodone 5 mg pills) to 2019 (33.3 oxycodone 5 mg pills). However, cumulative prescriptions within the 30PRE-90POST timeframe have decreased considerably from 2010 (128.5 oxycodone 5 mg pills) to 2019 (70.4 oxycodone 5 mg pills), and cumulative prescription filling in years 2018 and 2019 was significantly less than in 2010. Legislation targeting duration or duration and volume had the largest impacts on initial and cumulative opioid prescribing. ConclusionsIn ankle fracture surgery, states with opioid prescribing legislation had larger reductions in perioperative opioid prescribing compared to states without opioid legislation. Legislation targeting duration or duration and volume had the largest impacts on opioid prescribing. Level of evidenceLevel III, Retrospective prognostic cohort study.