This study addresses the integral role of typical wind power generation curves in the analysis of power system flexibility planning. A novel method is introduced for extracting these curves, integrating an enhanced K-means clustering algorithm with advanced optimization techniques. The process commences with thorough data cleaning, filtering, and smoothing. Subsequently, the refined K-means algorithm, augmented by the Pearson correlation coefficient and a greedy algorithm, clusters the wind power curves. The optimal number of clusters is ascertained through the silhouette coefficient. The final stage employs particle swarm and whale optimization algorithms for the extraction of quintessential wind power output curves, essential for flexibility planning in power systems. This methodology is validated through a case study involving wind power output data from a new energy-rich provincial power grid in North China, spanning from 1 January 2019, to 31 December 2022. The resultant curves proficiently mirror wind power fluctuations, thereby laying a foundational framework for power system flexibility planning analysis.