NCBI has a number of API's into their databases. A fairly simple model I used a few years ago is the Entrez Programming Utilities. "Esearch" and "Efetch" can be used to grab 100 records at a time in any of a number of formats. Restrictions and guidelines are posted on that page.