Pages:
Author

Topic: Data source url change (ticker, depth, history) (Read 17640 times)

legendary
Activity: 938
Merit: 1000
chaos is fun...…damental :)
@MagicalTux can you explain whit your ticker send a last price at 112 when the best bid was 140 ??
legendary
Activity: 938
Merit: 1000
chaos is fun...…damental :)
Magicaltux yesterday feeds from mtgox.com were timeouting since bitfinex.com is trading quite allot on your books can plz fix your stuff or provide a dedicated API
member
Activity: 77
Merit: 10
A Colt Crossed the River

The v0 getTrades is cached ~120 seconds, even with ?since=. The v1/v2 api is cached 15 seconds only if ?since= is passed.


Hi Tux,

What about the cache time of v1/v2 api of Ticker and Depth?
legendary
Activity: 1708
Merit: 1020
Quote
MtGox: 314.5 USD/BTC

The much I like that number...  is the ticker jumping for me only or for everybody?


Quote
{"saveTime": 1364484370.9484749, "warning": "THIS API IS DEPRECATED. Please upgrade to newer API such as https://data.mtgox.com/api/2/BTCUSD/money/ticker", "ticker": {"sell": 317, "buy": 314.5, "last": 314.5, "vol": 979, "last_local": 314.5, "last_all": 310.49079, "vwap": 299.89697478400001, "high": 316.91019, "low": 279.89999999999998, "avg": 301.46424582200001}}
Huh
newbie
Activity: 34
Merit: 0
But it was stated earlier that the "since" parameter is for a trade ID, not a timestamp, so I don't think that would work.
It does work, at least for me.  It appears they calculate trade id based on time stamp.  In every case I have examined, the trade id was the same as trade time, but with 6 extra digits.
member
Activity: 62
Merit: 45
2112, thanks for your help with that.

Anybody know if there's a way to specify that you want data since a certain date?  Like if I wanted the past 24 hours of trades, is there a way to do that? 
since is in time units*1000000
to start x hours ago you can calculate
   since = int(time() - x*60*60)*1000000
   url = "http://data.mtgox.com/api/1/BTCUSD/trades?since=" + str(since)

You will get batches of 100 trades, so you need to keep calling
with since set to highest tid in previous batch

But it was stated earlier that the "since" parameter is for a trade ID, not a timestamp, so I don't think that would work.
newbie
Activity: 34
Merit: 0
2112, thanks for your help with that.

Anybody know if there's a way to specify that you want data since a certain date?  Like if I wanted the past 24 hours of trades, is there a way to do that? 
since is in time units*1000000
to start x hours ago you can calculate
   since = int(time() - x*60*60)*1000000
   url = "http://data.mtgox.com/api/1/BTCUSD/trades?since=" + str(since)

You will get batches of 100 trades, so you need to keep calling
with since set to highest tid in previous batch

member
Activity: 62
Merit: 45
2112, thanks for your help with that.

Anybody know if there's a way to specify that you want data since a certain date?  Like if I wanted the past 24 hours of trades, is there a way to do that? 
legendary
Activity: 1708
Merit: 1020
Because of the hickups (price jumping randomly +-30%) in the old ticker I switched to the new one today.

Only now do I realize how messed up it really is.


For some reason the standard python json decoder decodes the numbers as unicode strings and not as numbers....

Probably these encoded chars are the problem:
vol":{"value":"72063.77361237","value_int":"7206377361237","display":"72,063.77\u00a0BTC","display_short":"72,063.77\u00a0BTC"

Took me a while to get aware of that, watch out.


edit: Now that was BS, the reason is the quotes around the numbers of course. why did you add quotes to the values?

legendary
Activity: 1708
Merit: 1020
as snoleo pointed out already:

why did you remove the old ticker and bloat it even more? it was too much already.


and the depth... oh my.
legendary
Activity: 2128
Merit: 1073
But who will be kind to come answer my question?  Huh
The answer is that they are trying to provide support for the FIX protocol http://en.wikipedia.org/wiki/Financial_Information_eXchange .
Please learn it or be left it the dustbin. There is no way forward that continues to use the old RPC polling paradigm.

Yep, see the top of the thread. The APIs will stay the same at launch. We will probably layer on FIX support for CoinLab customers.
member
Activity: 77
Merit: 10
A Colt Crossed the River
Hi Tux, I'm new to the API.  Can you tell me what the since= param means?  I imagine it means "trades since this time" or "trades since this far back", but I don't know what unit it's measuring in.  Minutes?  Hours?  Days?

since=N

It will get trades which were execuated after that trades ID N (excludes ID N)

PS: Tux seems too busy to answer our questions , so we have to try to help each other. But who will be kind to come answer my question?  Huh
member
Activity: 62
Merit: 45
Hi Tux, I'm new to the API.  Can you tell me what the since= param means?  I imagine it means "trades since this time" or "trades since this far back", but I don't know what unit it's measuring in.  Minutes?  Hours?  Days?
member
Activity: 77
Merit: 10
A Colt Crossed the River

The v0 getTrades is cached ~120 seconds, even with ?since=. The v1/v2 api is cached 15 seconds only if ?since= is passed.

However if you're looking for realtime activity, you should be using the realtime feeds.

Hi Tux,

1. About the cache time, does getDepth and ticker cached the same time as getTrades in v0?
2. What is the cache time of depth and trades in v1 and v2?
3. Would you please provide a v1/v2 api returned reduced data to save the bandwidth?
4. And if there is an api to provide the most recent 100 or 60 trades?

Sorry for so many questions. Please kindly give some specifications, thanks!
hero member
Activity: 931
Merit: 500
sr. member
Activity: 379
Merit: 250
Hi, You did not mention socket.io api url changes. Will it change too?

And if yes do you know about current socket.io behaviour? Client connects, connect event invoked, and then no any subscribtion message appear. Just silence.

Can you comment on this effect? What can be done?

No change on the socketio url, however we are testing a new system that'll be much better to handle the load. Tests are currently being done.

Hi, can you be so kind to tell more details about newsystem. In another thread they mentioned socketio-beta.mtgox.com I tried to connect there with my nodejs socket.io-client lib and got only multiple errors.

while the same lib seems compatible with the old socketio.mtgox.com but it is highly highly unstable. Very often  client connects (get connect event) and then nothing more just silence no any subscribtion mesages. Also I connect with such url https://socketio.mtgox.com/mtgox?Currency=USD,EUR,GBP,CNY,RUB,CAD,PLN,AUD which contains 8 currencies. Could this be an issue in my case?

please advice.
vip
Activity: 608
Merit: 501
-
So I guess maybe MtGox has cached the trades data for 2-3 minutes. Tux , would you please give some specification on that?

Hi,

The v0 getTrades is cached ~120 seconds, even with ?since=. The v1/v2 api is cached 15 seconds only if ?since= is passed.

However if you're looking for realtime activity, you should be using the realtime feeds.
member
Activity: 77
Merit: 10
A Colt Crossed the River
And I also find that maybe MtGox has cached the json data, since whether I use php curl or Chrome browser directly , I cannot get the trades executed in last 10-15 seconds . Instead , I always get the trades executed 1-3 minutes ago. And users watching the realtime trades data complain about the delays. 2-4 minutes is just too long.


So I guess maybe MtGox has cached the trades data for 2-3 minutes. Tux , would you please give some specification on that?
member
Activity: 77
Merit: 10
A Colt Crossed the River
Hi bzzard,

Are you the author of btccharts.com ?

It is a very great flash real time depth chart and I like it.  Smiley
sr. member
Activity: 398
Merit: 250
MagicalTux - please at least respond to snoleo post - APIv0 data format is actually great

I've talked also with MtGox support on this topic but they ignore this question.


Can you say in numbers - how much cache time is changed?


No change on the socketio url, however we are testing a new system that'll be much better to handle the load. Tests are currently being done.
Sounds great. So whats the name of new system? Or it's still socket.io?
Pages:
Jump to: