NCBI provides several tools for downloading custom data sets.
Entrez Programming Utilities (E-utilities)
The E-utilities are the public API to the NCBI Entrez system and allow access to all Entrez databases including PubMed, PMC, Gene, Nuccore and Protein. The E-utilities are a suite of eight server-side programs that accept a fixed URL syntax for search, link and retrieval operations. A companion package named Entrez Direct consists of several executables that allow the E-utilities to be called directly from a UNIX command line.
The SRA toolkit is a set of compiled binaries and corresponding source code for tools that download, manipulate and validate next-generation sequencing data stored in the NCBI SRA archive. The binaries are available for Windows, Mac OS X and LINUX platforms.
GEO2R is an analysis tool that identifies genes that are differentially expressed across experimental conditions by comparing two or more samples from GEO data sets. The results are a table of genes that can be downloaded.