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.
2 Answers
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
-
Perfect answer! BTW, I'll use this fast ticker in the next version of Bitcoin Paranoid: 1.5– FelipeCommented Apr 15, 2013 at 1:42
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