Author

Topic: Is BTC-China's API broken or is it just me? (Read 669 times)

newbie
Activity: 3
Merit: 0
June 24, 2014, 04:13:43 PM
#1
It might be that their API is broken, I have the btcchina file in my folder along with this:

  " import okcoin import csv import re import btcchina

    """API KEYS"""

    access_key= "XXXXXXX" secret_key= "XXXXXXX"

    bc = btcchina.BTCChina(access_key,secret_key)

    "BTC-CHINA FETCHING"

    result = bc.get_account_info()"

I always get the error:

    "C:\Python27\python.exe C:/Python27/OKCoin-API-master/examples.py Traceback (most recent call last): File "C:/Python27/OKCoin-API-master/examples.py", line 15, in result = bc.get_account_info() File "C:\Python27\OKCoin-API-master\btcchina.py", line 94, in get_account_info return self._private_request(post_data) File "C:\Python27\OKCoin-API-master\btcchina.py", line 68, in _private_request self.conn.request("POST",'/api_trade_v1.php',json.dumps(post_data),headers) File "C:\Python27\lib\httplib.py", line 946, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 986, in _send_request self.putheader(hdr, value) File "C:\Python27\lib\httplib.py", line 924, in putheader str = '%s: %s' % (header, '\r\n\t'.join(values))

    TypeError: sequence item 0: expected string, long found"

Link to their API: https://github.com/BTCChina/btcchina-api-python[1]

I'd be glad if someone could help me out!


Jump to: