Skip to content

Instantly share code, notes, and snippets.

@Thorium
Created February 2, 2017 18:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Thorium/d8cd4bb0610a8cb978591b3134100fc0 to your computer and use it in GitHub Desktop.
Save Thorium/d8cd4bb0610a8cb978591b3134100fc0 to your computer and use it in GitHub Desktop.
Bitcoin current price data from blockchain.info
//Using FSharp.Data
type BtcData = FSharp.Data.JsonProvider<"""{
"USD":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"$"},
"EUR":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"€"},
"GBP":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"£"}
}""">
let prices = BtcData.Load("https://blockchain.info/ticker")
//prices.Eur.Buy : val it : decimal = 923.52M (at 02/02/2017)
//prices.Gbp.Sell : val it : decimal = 794.61M (at 02/02/2017)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment