What is the refresh interval of MtGox ticker API?

3

I'm using the MtGox ticker API (from MtGox API V2) and I want to know the update interval. I think it is less than 3 minutes, but is it possible to know exactly? It is important to me because I'm developing an Android app that shows the current price to the user in notification bar.

Felipe

Posted 2013-04-14T02:38:21.783

Reputation: 1 511

I made now some tests and it seems to be less than one minute, but it variable. I don't know how they cache this value.Felipe 2013-04-14T02:40:57.060

Answers

7

if you want fast http ticker use the new fast_ticker : http://www.reddit.com/r/Bitcoin/comments/1c9npl/mtgox_fast_ticker_last_only_no_rate_limit_1second/

http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast

and you will get 1 second only cached minimalist ticker ( last )

if you need more ( low, high, volume ) you have the normal ticker, most probably cached 30 seconds :

http://data.mtgox.com/api/1/BTCUSD/ticker

the new data.mtgox.com is behind cloudflare now and the only ratelimits you will hit will now be cloudflare anti dos limits

old api urls not using data.mtgox are now deprecated and not guaranteed to work

neofutur

Posted 2013-04-14T02:38:21.783

Reputation: 1 495

Perfect answer! BTW, I'll use this fast ticker in the next version of Bitcoin Paranoid: 1.5Felipe 2013-04-15T01:42:02.487

0

To get the update interval for Mt.Gox HTTP v2 API endpoints, use the Cache-Control and Date/Expires HTTP headers.

I see a lot of misinformed information going around that the ticker_fast has a 1s cache time. I did some testing (with ticker and ticker_fast) and both the ticker and ticker_fast APIs won't update until their cache time has expired. This is a stateless API so everyone receives the same cache headers. The actual cache time varies somewhere between 20-30 seconds (at the time of writing this post), this might adjusts on-the-fly depending on how much server load they are receiving.

Try it yourself:

https://data.mtgox.com/api/2/BTCUSD/money/ticker_fast https://data.mtgox.com/api/2/BTCUSD/money/ticker

Druska

Posted 2013-04-14T02:38:21.783

Reputation: 139