Sorry, no, you'll just have to check for errors yourself. Anyway, the HTTP API can be unreliable at times so you will need to handle unexpected errors for all methods.
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
function auth() {
var RestKey= 'my API KEY';
var tonce = microtime();
var secret = 'my secret';
var message = 'BTCUSD/money/info' + '\0';
var RestSign = hmac_512(message,secret);
var path = 'https://data.mtgox.com/api/2/BTCUSD/money/info/';
var result = $.ajax({
url: path,
headers:{'tonce': tonce, 'Rest-Key': RestKey, 'Rest-Sign': RestSign},
type: 'POST',
success: function (data) {console.log(data);}
});
}
function hmac_512(message, secret) {
var shaObj = new jsSHA(message, "TEXT");
var hmac = shaObj.getHMAC(secret, "B64", "SHA-512", "B64");
return hmac;
}
function auth() {
var RestKey= 'my API KEY';
var tonce = microtime();
var secret = 'my secret';
var message = 'BTCUSD/money/info' + '\0';
var RestSign = hmac_512(message,secret);
var path = 'https://data.mtgox.com/api/2/BTCUSD/money/info/';
var result = $.ajax({
url: path,
headers:{'tonce': tonce, 'Rest-Key': RestKey, 'Rest-Sign': RestSign},
type: 'POST',
success: function (data) {console.log(data);}
});
}
function hmac_512(message, secret) {
var shaObj = new jsSHA(message, "TEXT");
var hmac = shaObj.getHMAC(secret, "B64", "SHA-512", "B64");
return hmac;
}
import hmac, base64, hashlib, urllib, time, requests
base = 'https://data.mtgox.com/api/2/'
key = ""
sec = ""
def request(get_or_post, path, inp={}):
def sign(path, data): # not used by any other functions
return hmac.new(base64.b64decode(bytes(sec, 'UTF-8')),
bytes(path+chr(0)+data, 'UTF-8'), hashlib.sha512)
if get_or_post == 'get':
return requests.get(base+path)
inp[u'tonce'] = str(int(time.time()*1e6))
post_data = urllib.parse.urlencode(inp)
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Rest-Key': key,
'Rest-Sign': base64.b64encode(sign(path, post_data).digest())
}
return requests.post(base+path, data = post_data, headers = headers)
# example: get
#r = request('get', 'BTCUSD/money/ticker_fast')
#print(r.text)
# example: post
#r = request('post', 'BTCUSD/money/info')
#print(r.text)
# example: post with params (use your own order ID here)
#data = {'order': 'd5111d57-c495-48a0-923d-59b729dba331', 'type':'ask'}
#r = request('post', 'BTCUSD/money/order/result', data)
#print(r.text)
!python3 /tmp/test.py
[No se ha escrito nada al disco desde el último cambio]
{"result":"success","data":{"order_id":"d5111d57-c495-48a0-923d-59b729dba331","trades":[{"trade_id":"1373688054789976","primary":"Y","currency":"USD","type":"ask
","properties":"limit","item":"BTC","amount":{"value":"0.01000000","value_int":"1000000","display":"0.01000000\u00a0BTC","display_short":"0.01\u00a0BTC","currenc
y":"BTC"},"price":{"value":"91.89874","value_int":"9189874","display":"$91.89874","display_short":"$91.90","currency":"USD"},"spent":{"value":"0.91899","value_in
t":"91899","display":"$0.91899","display_short":"$0.92","currency":"USD"},"date":"2013-07-13 04:00:54"}],"total_amount":{"value":"0.01000000","value_int":"100000
0","display":"0.01000000\u00a0BTC","display_short":"0.01\u00a0BTC","currency":"BTC"},"total_spent":{"value":"0.91899","value_int":"91899","display":"$0.91899","d
isplay_short":"$0.92","currency":"USD"},"avg_cost":{"value":"91.89900","value_int":"9189900","display":"$91.89900","display_short":"$91.90","currency":"USD"}}}