CMS produces Medicare Fee-For-Service Public Provider Enrollment Data or CMS PPEF data. "The Public Provider Enrollment data for Medicare fee-for-service includes providers who are actively approved to bill Medicare or have completed the 855O at the time the data was pulled from the Provider Enrollment and Chain Ownership System (PECOS)."
"These files are populated from PECOS and contain basic enrollment and provider information, reassignment of benefits information and practice location city, state and zip."
The Medicare Fee-For-Service Public Provider Enrollment Data or CMS PPEF data is offered here in SAS, Stata, and CSV formats to make the data a bit easier to use.
Some historic files are available in the CCYY/MM folders where CCYY is the year and MM is the month