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

CC BY-SA 3.0
2017-12-23T01:15:26.990Z
2017-12-23T01:15:26.990Z
Chris W.
<p>You could use the JSON encoded ticker data available from MtGox at: <a href="https://mtgox.com/api/0/data/ticker.php">https://mtgox.com/api/0/data/ticker.php</a></p>

<p>Just use whatever your language's equivalent to <a href="http://php.net/manual/en/book.curl.php">cURL</a> or <a href="http://www.gnu.org/s/wget/">wGet</a> is and parse as appropriate.</p>

CC BY-SA 3.0
2017-12-23T01:15:01.470Z
Unsurprisingly (to anyone familiar with the now-infamous Mt Gox saga), this method will no longer work.
Chris W.
CC BY-SA 3.0
2011-10-25T14:40:30.050Z
2011-10-25T14:40:30.050Z
David Perry
<p>You could try using <a href="http://www.btcrate.com">www.btcrate.com</a> as well, which supports additional currencies (should you need them).</p>

CC BY-SA 3.0
2011-10-30T07:40:17.690Z
2011-10-30T09:13:54.860Z
2011-10-30T09:13:54.860Z
user632
<p>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?</p>

<p>(Actually writing the script is not the problem, in my case.)</p>

CC BY-SA 3.0
2011-10-31T14:18:55.220Z
FYI, I ended up using the [API of BitcoinCharts.com](http://bitcoincharts.com/about/markets-api/) 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.
<development><exchanges><exchange-rate>
What is the easiest way to programmatically obtain the current USD-BTC spot price?
Chris W.
# What is the easiest way to programmatically obtain the current USD-BTC spot price?

(Asked by: username_0 on 2011-10-25)

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

**Tags:** development, exchanges, exchange-rate

> **Comments:**
> **username_0**: FYI, I ended up using the [API of BitcoinCharts.com](http://bitcoincharts.com/about/markets-api/) 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.  

---

## 3 answers

### Answer by username_0 on 2017-12-23. Score: 0 | Accepted answer

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


---

### Answer by username_1 on 2011-10-25. Score: 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](http://php.net/manual/en/book.curl.php) or [wGet](http://www.gnu.org/s/wget/) is and parse as appropriate.

> **Comments:**
> **username_0**: Unsurprisingly (to anyone familiar with the now-infamous Mt Gox saga), this method will no longer work.  

---

### Answer by username_2 on 2011-10-30. Score: 5

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


---

