I am trying to write a simple script to verify that I am making an API call correctly, and then I plan to create a more complex program from there. The answer to the error I get is:
{"error":"Invalid API key\/secret pair."}
The API documentation I'm working on can be found at:
https://poloniex.com/support/api/
I just increased the nonce knob to make things simple.
My code is:
import urllib import urllib2 import json import time import hmac,hashlib APIKey = "<my_API_key>" Secret = "<my_secret>" post_request "command=returnBalances" sign = hmac.new(Secret, post_request, hashlib.sha512).hexdigest() ret = urllib2.urlopen(urllib2.Request("https://poloniex.com/tradingApi? key=" + APIKey + "&sign=" + sign + "&nonce=0008")) print ret.read()
source share