This repository includes an R client for the USGS-EROS espa ordering system API, which can be found here. The contained script /espa_client/espa_example.R offers a short explanation on how to use the client. The client takes product IDs, e.g. for specific Landsat scenses, provided within an input .txt file, performs a check of there vadility, places the required orders, indexes and waits the server-side processing status and downloads and MD5-checksums the products when they are ready.
The client does not offer querying by search parameters such as date or region, since espa is build for on-demand pre-processing. For further information, please be referred to this explanation by USGS-EROS.