For my work I often have to download official exchange rates. Thankfully the ECB publishes their reference rates in their Statistical Data Warehouse, and allows automatic download via an API.
I wrote a small R package to implement the API, and published it on github. Now, getting the latest rates for the USD is as easy as writing get_ecb_fx("USD")
.