Objective To estimate the incidence and prevalence of polycystic ovary syndrome (PCOS) in UK primary care and investigate prescribing patterns before and after a PCOS diagnosis. Design Retrospective cohort study. Setting UK primary care (2004–2014). Participants Women aged 15–45 years. Primary and secondary outcome measures The incidence and prevalence of diagnosed PCOS and probable PCOS (ie, those without a confirmed diagnosis but with at least 2 PCOS features recorded within 3 years). Among women with diagnosed or probable PCOS, the prevalence of prescribing of drugs typically used to treat PCOS was calculated prior to and in the 24 months after the diagnosis of PCOS. Results We identified 7233 women with PCOS diagnoses and 7057 women with records suggestive of probable PCOS, corresponding to incidence rates of 0.93 and 0.91 per 1000 person-years at risk (PYAR) and an overall rate of 1.84 per 1000 PYAR. Women aged 20–24 years and women living in deprived areas had the highest incidence of PCOS. The prevalence of PCOS in 2014 was ∼2%. The proportion of women with a prescription in the 24 months after their PCOS index date varied by drug type: 10.2% metformin, 15.2% combined oral contraceptives, 18.8% acne-related treatments, 1.93% clomiphene, 1.0% spironolactone, 0.28% cyproterone and 3.11% eflornithine. Acne-related treatments were more commonly used to treat probable (28.3%) than diagnosed (12.3%) cases, while metformin was prescribed much more commonly in diagnosed cases. Conclusions In conclusion, compared to rates estimated in community samples, the incidence and prevalence of women presenting in primary care with PCOS diagnoses and features are low, indicating that PCOS is an under-recognised condition. Although considerable variation is observed in treatments prescribed to women with PCOS, the treatments initiated following a confirmed diagnosis generally reflect the long-term prognostic concerns raised in PCOS consensuses.