Home Notices Documents Classes Download Others Rice
Classes  >  bitbankapi  >  Ticker(string)
bitbankapi class : Ticker(string) method

Description

Gets ticker information.

Syntax

bitbankapiInstance.Ticker(string currencyPair)

Arguments

ClassNameDescription
stringcurrencyPairCurrency pair.

Return value

ClassDescription
ClassDescription

Sample code

1:

bitbankapi bitbankapiIns = new bitbankapi();

2:

bitbankres bitbankresIns = bitbankapiIns.Ticker("btc_jpy");

3:

string jsonStr = bitbankresIns.Result;

Example for JSON-text

{"success":1,"data":{"sell":"1077098","buy":"1076807","high":"1085000","low":"1056913","last":"1076806","vol":"1082.4489","timestamp":1582242128197}}

Notes

Public API. API key and secret key are unnecessary.

If a valid currency pair is specified as an argument, ticker information on that currency pair is returned.

Valid arguments : btc_jpy, xrp_jpy, ltc_btc, eth_btc, mona_jpy, mona_btc, bcc_jpy, bcc_btc

An instance of the bitbankres class is returned as the response to the request. This instance holds the JSON-text of the result of the response.

If the argument is incorrect, the following JSON-text will be returned.

{"success": 1000,"return": { "message": "http error"}}

If an HTTP error occurs, the following JSON-text will be returned.

{"success": -1000,"error": { "statuscode" : 404, "message": "Not Found"}}

"statuscode" and "message" are different for each HTTP error.

If the request times out, the following JSON-text is returned.

{"success": -1001,"error": { "typename" : "TaskCanceledException", "message": "A task was cancelled."}}

If the request fails due to other exceptions, the following JSON-text will be returned.

{"success": -1002,"error": { "typename" : "...", "message": "..."}}

"typename" and "message" are different for each exception.

Links for reference

Copyright © Rice All rights reserved.