What is the easiest way to programmatically obtain the current USD-BTC spot price?

11

1

E.g., if I wanted to create a cron script that would grab the latest spot price every hour and store it in a local file or database, what would be the place to "scrape" that information from?

(Actually writing the script is not the problem, in my case.)

Chris W.

Posted 2011-10-25T14:27:52.677

Reputation: 230

FYI, I ended up using the API of BitcoinCharts.com to do this. The Mt Gox API may have worked just as well in my case, but for whatever reason, I was having an issue with my (Python) script that attempted to poll mtgox.com -- it would hang upon making the HTTPS request.

Chris W. 2011-10-31T14:18:55.220

Answers

0

There are probably dozens of sites that now provide this data, but the CoinDesk API is one option.

Chris W.

Posted 2011-10-25T14:27:52.677

Reputation: 230

10

You could use the JSON encoded ticker data available from MtGox at: https://mtgox.com/api/0/data/ticker.php

Just use whatever your language's equivalent to cURL or wGet is and parse as appropriate.

David Perry

Posted 2011-10-25T14:27:52.677

Reputation: 13 848

Unsurprisingly (to anyone familiar with the now-infamous Mt Gox saga), this method will no longer work.Chris W. 2017-12-23T01:15:01.470

5

You could try using www.btcrate.com as well, which supports additional currencies (should you need them).

user632

Posted 2011-10-25T14:27:52.677

Reputation: 51