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

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

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.)

Solutions/Answers:

Answer 1:

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.

Answer 2:

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

Answer 3:

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

Our Awesome Tools

References