Hmmm - I just got API v2 working here BUT there's a bit of a problem fetching trades with API v1 and API v2 - MtGox will return 1000 trades instead of 100 (with API 0), so the data traffic will increase 10-fold (and it will update a lot slower!) :/
Unfortunately there doesn't seem to be any parameter to specify how many trades we want to fetch (we only need ONE sample for each interval!) The docs for API v2 is quite limited however - anyone know if there's a way to fetch single historical trades using API v2?
The reason it's replying with a lot of trades is that in API v2, it will return the last 24h history by default if you don't specify anything and just fetch /money/trades
You can add a ?since= parameter at the end of the url to have it return only trades since that order id. Also, if you do that it'll then reply in chunks of 100 trades like you want.
To quote this post
https://bitcointalk.org/index.php?topic=150786.msg1690500#msg1690500since 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
Hope this helps.