json - Kraken-API: input-option; Python -


i've been trying load kraken-api-content hours now, still doesn't work. problem following: in api-description https://www.kraken.com/help/api#public-market-data there says "input". i.e. url https://api.kraken.com/0/public/assetpairs optional use "input": "info = leverage", otherwise works default "info = info". python2.7-code

import os import urllib, json import time dir_path_this = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path_this) url = "https://api.kraken.com/0/public/assetpairs" filename_pair = "pair"+ ".json" response = urllib.urlopen(url) pairinfo_dict = json.loads(response.read()) open(filename_pair, 'wb') outfile: json.dump(pairinfo_dict, outfile) 

works fine, because "input" taken default, don't have set it. url https://api.kraken.com/0/public/ticker have tell python "input": "pair = comma delimited list of asset pairs info on", says in api-description. when run code above latter url, error, because "input" isn't set default , don't know how change code in order tell python input-option use.

does know parameter or argument have explicitly set?

you can append query parameters url this:

url = "https://api.kraken.com/0/public/ticker?pair=xxrpzusd,xxrpxxbt" 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -