PurposeBreast cancer is the most common cancer among Japanese women and often yields a better prognosis than other cancers. However, few studies have been conducted on pain control using opioids in Japan. In this study, we aimed to examine actual opioid use among breast cancer patients.MethodsBreast cancer patients were defined as female patients with a first breast cancer diagnosis during the observational period in an acute care hospital database (April 2008 − February 2020). We examined the percentage of patients prescribed opioids, the opioid amount per patient, and the opioid dosage per day around surgery, bone metastasis diagnosis, or death.ResultsOverall, 217,722 breast cancer patients were identified. The percentage of patients prescribed opioids and the average amount of opioids per patient were highest in the month of surgery, 78% and 27 morphine milligram equivalents (MMEs), respectively. The average opioid dosage increased with time after surgery from 19 to 28 MMEs. Around bone metastasis, the percentage of patients prescribed opioids and the average opioid amount per patient peaked one month after the diagnosis, 31% and 371 MMEs, respectively. The average opioid dosage gradually increased from 22 to 35 MMEs in succeeding days after a bone metastasis diagnosis. The percentage of patients prescribed opioids and the average opioid amount per patient increased as the month of death approached.ConclusionWe investigated opioid prescription trends around clinical events in breast cancer patients on a large scale in Japan. These results may be useful to control cancer pain among breast cancer patients.Supplementary informationThe online version contains supplementary material available at 10.1007/s00520-023-07805-4.