Bitcoin Forum
July 25, 2017, 01:48:15 AM *
News: BIP91 seems stable: there's probably only slightly increased risk of confirmations disappearing. You should still prepare for Aug 1.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Kraken API: "ValueError: No JSON object could be decoded"  (Read 131 times)
rothj
Newbie
*
Offline Offline

Activity: 1


View Profile
July 09, 2017, 12:00:41 AM
 #1

I'm working with the Kraken API to pull OHLC data and am receiving the following error in some of my API requests:

"Traceback (most recent call last):
  File "/Users/someone/anaconda/lib/python2.7/site-packages/krakenex/api.py", line 83, in _query
    return json.loads(ret)
  File "/Users/someone/anaconda/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/Users/someone/anaconda/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/someone/anaconda/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded"

Can anyone advise me on how to avoid this error?

Thanks!
Jake
1500947295
Hero Member
*
Offline Offline

Posts: 1500947295

View Profile Personal Message (Offline)

Ignore
1500947295
Reply with quote  #2

1500947295
Report to moderator
Decentralized search
Search for products or services and get paid for it
Join pre-ICO
25 July. 50% discount
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1500947295
Hero Member
*
Offline Offline

Posts: 1500947295

View Profile Personal Message (Offline)

Ignore
1500947295
Reply with quote  #2

1500947295
Report to moderator
1500947295
Hero Member
*
Offline Offline

Posts: 1500947295

View Profile Personal Message (Offline)

Ignore
1500947295
Reply with quote  #2

1500947295
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 980


Bitcoin's dominance=100,000 merchants accepting it


View Profile
July 09, 2017, 03:38:01 AM
 #2

you have to post the code that you used, or at least the value that passed in that code as the JSON data not the exception that was thrown.

my guess is you passing something that is not a JSON as a JSON to your code which is why it can not decode it.

break down your code to where you are passing that JSON in and see what the real value is.

this is what that JSON should look like: https://api.kraken.com/0/public/OHLC?pair=XBTUSD&interval=1440

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!