This question already has an answer here:

  1. can a contract on blockchain get outside data like "current dollar/ether exchange rate" using api like call??
  2. If yes, how can it be done? and is there any technique to control the behaviour of the contract depending on outside factors like fluctuations in ether/ dollar currency?

marked as duplicate by eth Jul 25 '16 at 12:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.