Is there an API with which I could obtain the exchange rate of bitcoin to dollar some time in the past by giving the desired time as parameter?
You can use winkdex.com api, it accepts a unix timestamp as a parameter.
http://docs.winkdex.com/#price